HP3000-L Archives

June 1998, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Tony Peters <[log in to unmask]>
Reply To:
Date:
Thu, 25 Jun 1998 09:36:11 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (222 lines)
Jacek Piskorz wrote.....
>>Can I check by Cobol program is the DDS tape into drive?
  I probably have to use intrinsic.... I try use FOPEN, but when tape
  is outside - program pause until I put the tape into drive.
  How check - is tape into drive or not. <<


We have a new operator in a basically lights-out operation who forgets to change
the tapes before going home, so I set up a quick job to remind  him.
There are probably better ways of doing this but it works.

We also incorporate the code into our normal backup job so the job does not hang
at 4:00am waiting for the tape.  It allows the processes and waiting jobs to be 
started and pages the operator using DigiPage(from the CSL) to inform him so he 
can come in early and do a "quick" backup of critical databases.

This is the job to check the tape.  It uses the fact that the showdev command 
returns different info depending on whether a tape is loaded or not.

!JOB TAPEOKJ,MGR/PASSWORD.ACCC,JOB;HIPRI;OUTCLASS=TOLJ,6
!COMMENT ***********************************************
!COMMENT * This job tests for a tape on device DAT and *
!COMMENT * whether it is online with write enabled by  *
!COMMENT * doing a showdev DAT to a file and parsing   *
!COMMENT * the file for the "(W)" write indicator.     *
!COMMENT * NOTE - THIS CODE ALSO IN BKUPSTDJ.JOB.COM   *
!COMMENT ***********************************************
!SETVAR TAPEOK "NO"
!IF FINFO("TAPEF",'EXISTS')
!  PURGE TAPEF
!ENDIF
!FILE TAPEF;MSG;REC=-80,,F,ASCII;SAVE
!SHOWDEV DAT >>*TAPEF
!WHILE FINFO("TAPEF",'EOF') > 0
!  INPUT REC < TAPEF
!  IF ![POS("(W)","!REC")]>0 THEN
!     SETVAR TAPEOK "YES"
!  ENDIF
!ENDWHILE
!IF "!TAPEOK"="YES"
!  TELLOP TAPE FOUND MOUNTED ON LDEV7 WITH WRITE ENABLED
!ELSE
(24/33) Continue? 
!  TELLOP  ********************************************
!  TELLOP  TAPE NOT FOUND ON LDEV7 OR WRITE NOT ENABLED
!  TELLOP  ********************************************
!ENDIF
!IF FINFO("TAPEF",'EXISTS')
!  PURGE TAPEF
!ENDIF
!EOJ


THe backup job is shown here.  It is somewhat complex, as it stops all 
processes, waits for a while for any executing job to finish then aborts 
anything that is left(including users) does the backup and reinitializes the 
processes it stopped.  It also sets limits to allow certain jobs to run after 
backup.

!JOB BACKUPJ,MGR/password.accc,JOB;HIPRI;OUTCLASS=TOLJ,6
!COMMENT  ****************************************************
!COMMENT  * This job is the Standard Daily Backup job which is
!COMMENT  * normally used to backup the system using the list
!COMMENT  * of files in BACKUP.JOB.COM.  To use this job, COPY
!COMMENT  * it to BACKUPJ.JOB.COM for Sleeper to stream.
!COMMENT  * Note:  Any changes to this file must be duplicated in
!COMMENT  * the other BKUP***J.JOB.COM files.  DO NOT change BACKUPJ.
!COMMENT  ****************************************************
!COMMENT * We will now read the file BKUPSKIP.JOB.COM for the
!COMMENT * days on which we do not want a backup for holiday.
!COMMENT * This job will not do a backup on these days or Sunday
!COMMENT * and Monday.  On Those days it will just shut down all
!COMMENT * processes and restart them.
!COMMENT *********************************************************
!SETVAR SCCURDATE '![rht("!HPYYYY",4)]'&
!   +'![rht("0!HPMONTH",2)]'+'![rht("0!HPDATE",2)]'
!SETVAR SCSKIPDATE "NO"
!IF FINFO("SKIPF",'EXISTS')
!  PURGE SKIPF
!ENDIF
!FILE SKIPF;MSG;REC=-30,,F,ASCII;SAVE
!PRINT BKUPSKIP, *SKIPF
!WHILE FINFO("SKIPF",'EOF') > 0
!  INPUT SKIPREC < SKIPF
!  IF "![LFT("!SKIPREC",1)]"<>"*"
!    IF "!SCCURDATE"="![LFT("!SKIPREC",8)]"
!      SETVAR SCSKIPDATE "YES"
!      SHOWVAR S@
!      TELLOP **********************************************
!      TELLOP *  BACKUP SKIPPED BY BKUPSKIP.JOB.COM        *
!      TELLOP *  DATE IN FILE IS !SCCURDATE              *
!      TELLOP **********************************************
!    ENDIF
!  ENDIF
!ENDWHILE
!IF FINFO("SKIPF",'EXISTS')
!  PURGE SKIPF
!ENDIF
!SHOWJOB
!COMMENT ########################################################
!COMMENT If a backup is not being done, set the variable to NO
!COMMENT and wait up to 75 minutes for jobs to finish, otherwise
!COMMENT set variable to YES and only wait 15 min. to abort jobs.
!COMMENT ########################################################
!IF HPDAY=1 OR HPDAY=2 OR "!SCSKIPDATE"="YES" THEN
!  SETVAR MAXTIMES 15
!  SETVAR DOBACKUP "NO"
!  TELLOP **********************************************
!  TELLOP *  SHUTTING DOWN ALL USER PROCESSES AND      *
!  TELLOP *  REINITIALIZING THEM. BACKUP NOT REQ'D     *
!  TELLOP **********************************************
!ELSE
!  SETVAR MAXTIMES 3
!  SETVAR DOBACKUP "YES"
!  TELLOP **********************************************
!  TELLOP *  SHUTTING DOWN ALL USER PROCESSES AND      *
!  TELLOP * DOING A FULL BACKUP USING BACKUP.JOB.COM   *
!  TELLOP **********************************************
!ENDIF
!LIMIT 0,0
!XEQ DCOFF.CMD.COM
!ABORTJOB SLEEPER,MANAGER.SYS
!PAUSE 120
!FILE LP;DEV=TOLJ
!FILE TF;MSG;REC=-72,,F,ASCII
!SETVAR TIMES 0
!COMMENT For the number of times selected, wait for jobs to finish.
!WHILE TIMES < !MAXTIMES
!  SETVAR TIMES TIMES+1
!  SHOWJOB JOB=@J;EXEC>*TF
!  SHOWJOB JOB=@J;EXEC>*LP
!  IF ![FINFO("TF",'EOF')] > 10
!    PAUSE 300
!  ELSE
!    SETVAR TIMES !MAXTIMES + 1
!  ENDIF
!ENDWHILE
!COMMENT If jobs are still logged on, abort them, but do not
!COMMENT abort system jobs or Backup job.
!IF TIMES=!MAXTIMES
!  WHILE FINFO("TF",'EOF') > 0
!    INPUT FILE < TF
!    IF "![STR("!FILE",1,2)]"= "#J" THEN
!      IF ![POS("!HPJOBTYPE!HPJOBNUM","!FILE")]=0 THEN
!        IF ![POS("KAS20","!FILE")]=0 THEN
!          IF ![POS("MANAGER.RAC","!FILE")]=0 THEN
!           TELLOP ABORTED ![STR("!FILE",1,7)] ![STR("!FILE",45,18)]
!           ABORTJOB ![STR("!FILE",1,7)]
!          ENDIF
!        ENDIF
!      ENDIF
!    ENDIF
!  ENDWHILE
!ENDIF
!COMMENT Do the backup if required.
!IF "!DOBACKUP"="YES" THEN
!  PAUSE 120
!  SETVAR TAPEOK "NO"
!  IF FINFO("TAPEF",'EXISTS')
!    PURGE TAPEF
!  ENDIF
!  FILE TAPEF;MSG;REC=-80,,F,ASCII;SAVE
!  SHOWDEV DAT >>*TAPEF
!  WHILE FINFO("TAPEF",'EOF') > 0
!    INPUT REC < TAPEF
!    IF ![POS("(W)","!REC")]>0 THEN
!       SETVAR TAPEOK "YES"
!    ENDIF
!  ENDWHILE
!  IF "!TAPEOK"="YES"
!    TELLOP TAPE FOUND MOUNTED ON LDEV7 WITH WRITE ENABLED
!    TELLOP   ******  STARTING BACKUP NOW ******
!    FILE DAT;DEV=DAT
!    FILE SYSLIST;DEV=TOLJ
!    STORE ^BACKUP.JOB.COM;*DAT;DIRECTORY;PROGRESS=10;ONERROR=QUIT;&
!    COMPRESS=HIGH;INTER;MAXTAPEBUF
!  ELSE
!    TELLOP ![ENH]B ********************************************
!    TELLOP ![ENH]B TAPE NOT FOUND ON LDEV7 OR WRITE NOT ENABLED
!    TELLOP ![ENH]B BACKUP NOT DONE.  SYSTEM SETUP WILL CONTINUE
!    TELLOP ![ENH]B ********************************************![BELL]
!    SETVAR MISCERR "TAPE NOT FOUND ON LDEV7 OR WRITE NOT ENABLED"
!  ENDIF
!  IF FINFO("TAPEF",'EXISTS')
!    PURGE TAPEF
!  ENDIF
!ENDIF
!COMMENT Reset the limits and restart the standard jobs and sessions
!TELLOP SETTING SESSION LIMITS TO 80
!LIMIT 0,80
!PAUSE 60
!XEQ DCON.CMD.COM   (command file to start up data collection)
!STREAM SLEEPERJ.SYSOPER.SYS
!PAUSE 15
!COMMENT Set joblimit to allow 1 job to run after Backup logs off.
!TELLOP SETTING JOB LIMITS TO !hpjobcount
!LIMIT !hpjobcount
!COMMENT Set jobfence to allow inpri 3 and 2 jobs to run.
!TELLOP SETTING JOBFENCE TO 0
!JOBFENCE 0
!COMMENT Backup the ready spoolfiles in case of printer problems
!STREAM BKUPSPFJ.JOB.COM
!XEQ JEDI.CMD.COM       (Job Error Detection and Investigation)
!EOJ

It is JEDI which detects the tape error via the variable "MISCERR" set in the 
tape check section and it is JEDI which informs DIGIPAGE to call with a coded 
message giving the operator the job number and the error code.


                                          Tony Peters                     
       _/_/_/_/_/           _/_/_/_/_/    Project Manager - New Technology
      _/            _/     _/      _/     S&C Electric Canada Ltd          
     _/            _/     _/              90 Belfield Rd                   
    _/_/_/_/_/  _/_/_/   _/               Toronto ON  M9W 1G4              
           _/    _/     _/                Ph  416 249-9171                 
          _/    _/     _/      _/         Fax 416 249-3193                 
 _/_/_/_/_/           _/_/_/_/_/          Email   [log in to unmask]        
                                                                           
My Thoughts, My Fault.  Don't blame anyone else, cause they have no idea 
what I am thinking.  Good thing too.

ATOM RSS1 RSS2