Anyone who has used group jobs regularly has undoubtedly issued a signoff just as he or she remembered that another job in the group was already active - like Order Entry, a job that is not always easy to restart. When this happens, the other job is ended abnormally. To recover you would probably need to go into a system control file and change the flag that says Order Entry is active. This is relatively simple, but it takes take time, and in this world, time is money!
To prevent a signoff from making your life more difficult, I have written a simple command and command processing program, both called SIGNOFF (Figures 1 and 2). It works by checking to see if the job from which you are signing off is a group job. If it is, the command will end only the current job and switch you to the previously active group job.
After entering these two source members, compile them into a library that will be placed ahead of library QSYS in your system library list. I use QSYSMODS to contain commands that I want to use in place of OS/400 commands. Even the most conscientious people can forget. So next time you arbitrarily type in signoff, be assured that you don't have to worry about that group job that you started earlier.
Bernal Schooley Mount Prospect, Illinois
TechTalk: Safeguard Your SIGNOFF Command
Figure 1 Command SIGNOFF
FDSNLF O F 92 DISK A * E KEY 20 10 KEY FIELDS E HEXSLT 20 49 SELECT STATEMENTS E HEXOMT 20 49 OMIT STATEMENTS E X 92 1 DDS SPECIFICATION * I DS I 1 49 ELEM I 1 2 HEX I 3 6 OPER I 7 16 FIELD I 17 19 COMP I 18 19 COMP2 I 20 44 CONST I 45 49 FLDTYP * C *ENTRY PLIST C PARM QPF 23 C PARM RCDNAM 10 C PARM KEY C PARM #KEY 50 C PARM HEXSLT C PARM #SLT 50 C PARM HEXOMT C PARM #OMT 50 *Initialize program variables C Z-ADD100 SEQ# 60 C TIME SYS 120 C MOVE SYS SYSDAT 60 C MOVE SEQ# SEQCHR 6 C MOVE SYSDAT DATCHR 6 *Write the first DDS specification C EXCPTRECORD C ADD 100 SEQ# C MOVE SEQ# SEQCHR *Process all "key" specifications C 1 DO #KEY I C KEY,I IFNE *BLANK C EXSR WRTKEY C ADD 100 SEQ# C MOVE SEQ# SEQCHR C END C END *Process all "select" specifications C MOVE 'Y' FIRST 1 C MOVE 'S' SLTOMT 1 C 1 DO #SLT I 20 C MOVE HEXSLT,I ELEM C FIELD IFNE *BLANK C EXSR WRTSLT C ADD 100 SEQ# C MOVE SEQ# SEQCHR C END C END *Process all "omit" specifications C MOVE 'Y' FIRST 1 C MOVE 'O' SLTOMT 1 C 1 DO #OMT I 20 C MOVE HEXOMT,I ELEM C FIELD IFNE *BLANK C EXSR WRTSLT C ADD 100 SEQ# C MOVE SEQ# SEQCHR C END C END * C SETON LR C RETRN * C WRTKEY BEGSR C MOVEA*BLANK X C MOVE 'A' X,18 C MOVE 'K' X,29 C MOVE KEY,I KEYFLD 10 C MOVEAKEYFLD X,31 C EXCPTSPEC C ENDSR * C WRTSLT BEGSR C MOVEA*BLANK X C MOVE 'A' X,18 C FIRST IFEQ 'Y' C OPER OREQ '*OR ' C MOVE SLTOMT X,29 1 C MOVE 'N' FIRST C END C MOVEAFIELD X,31 C MOVEA'COMP(' X,57 C MOVEACOMP2 X,62 C FLDTYP IFEQ '*CHAR' C MOVE '''' X,65 C MOVEACONST X,66 C MOVE '''' CHAR 1 C EXSR CLOSE C ELSE C MOVEACONST X,65 C END C MOVE ')' CHAR C EXSR CLOSE C EXCPTSPEC C ENDSR * C CLOSE BEGSR C MOVE 'N' FOUND 1 C Z-ADD92 J 20 C FOUND DOWEQ'N' C X,J IFNE *BLANK C MOVE 'Y' FOUND C ADD 1 J C END C SUB 1 J C END C ADD 1 J C CHAR IFEQ '''' C CONST ANDEQ*BLANK C ADD 1 J C END C MOVE CHAR X,J C ENDSR * ODSNLF EADD RECORD O SEQCHR 6 O DATCHR 12 O 18 'A' O 29 'R' O RCDNAM 40 O 61 'PFILE' O QPF 84 O EADD SPEC O X 92 O SEQCHR 6 O DATCHR 12
TechTalk: Safeguard Your SIGNOFF Command
Figure 2 CL program SIGNOFF
FDSNLF O F 92 DISK A * E KEY 20 10 KEY FIELDS E HEXSLT 20 49 SELECT STATEMENTS E HEXOMT 20 49 OMIT STATEMENTS E X 92 1 DDS SPECIFICATION * I DS I 1 49 ELEM I 1 2 HEX I 3 6 OPER I 7 16 FIELD I 17 19 COMP I 18 19 COMP2 I 20 44 CONST I 45 49 FLDTYP * C *ENTRY PLIST C PARM QPF 23 C PARM RCDNAM 10 C PARM KEY C PARM #KEY 50 C PARM HEXSLT C PARM #SLT 50 C PARM HEXOMT C PARM #OMT 50 *Initialize program variables C Z-ADD100 SEQ# 60 C TIME SYS 120 C MOVE SYS SYSDAT 60 C MOVE SEQ# SEQCHR 6 C MOVE SYSDAT DATCHR 6 *Write the first DDS specification C EXCPTRECORD C ADD 100 SEQ# C MOVE SEQ# SEQCHR *Process all "key" specifications C 1 DO #KEY I C KEY,I IFNE *BLANK C EXSR WRTKEY C ADD 100 SEQ# C MOVE SEQ# SEQCHR C END C END *Process all "select" specifications C MOVE 'Y' FIRST 1 C MOVE 'S' SLTOMT 1 C 1 DO #SLT I 20 C MOVE HEXSLT,I ELEM C FIELD IFNE *BLANK C EXSR WRTSLT C ADD 100 SEQ# C MOVE SEQ# SEQCHR C END C END *Process all "omit" specifications C MOVE 'Y' FIRST 1 C MOVE 'O' SLTOMT 1 C 1 DO #OMT I 20 C MOVE HEXOMT,I ELEM C FIELD IFNE *BLANK C EXSR WRTSLT C ADD 100 SEQ# C MOVE SEQ# SEQCHR C END C END * C SETON LR C RETRN * C WRTKEY BEGSR C MOVEA*BLANK X C MOVE 'A' X,18 C MOVE 'K' X,29 C MOVE KEY,I KEYFLD 10 C MOVEAKEYFLD X,31 C EXCPTSPEC C ENDSR * C WRTSLT BEGSR C MOVEA*BLANK X C MOVE 'A' X,18 C FIRST IFEQ 'Y' C OPER OREQ '*OR ' C MOVE SLTOMT X,29 1 C MOVE 'N' FIRST C END C MOVEAFIELD X,31 C MOVEA'COMP(' X,57 C MOVEACOMP2 X,62 C FLDTYP IFEQ '*CHAR' C MOVE '''' X,65 C MOVEACONST X,66 C MOVE '''' CHAR 1 C EXSR CLOSE C ELSE C MOVEACONST X,65 C END C MOVE ')' CHAR C EXSR CLOSE C EXCPTSPEC C ENDSR * C CLOSE BEGSR C MOVE 'N' FOUND 1 C Z-ADD92 J 20 C FOUND DOWEQ'N' C X,J IFNE *BLANK C MOVE 'Y' FOUND C ADD 1 J C END C SUB 1 J C END C ADD 1 J C CHAR IFEQ '''' C CONST ANDEQ*BLANK C ADD 1 J C END C MOVE CHAR X,J C ENDSR * ODSNLF EADD RECORD O SEQCHR 6 O DATCHR 12 O 18 'A' O 29 'R' O RCDNAM 40 O 61 'PFILE' O QPF 84 O EADD SPEC O X 92 O SEQCHR 6 O DATCHR 12
LATEST COMMENTS
MC Press Online