|
|||||||||||
|
Chicago-Soft
|
Quick Tip - RUNS by Shannon P. Futch Previously our toll clerks were manually reviewing reports and extracting total number of messages processed from each source (source = tape/cart received or ndm transmission), then adding together all messages processed from each source to arrive with a total number of messages received. The following REXX exec is used to read a QSAM flat file that has been updated by each source job. This file is opened EXTEND in a COBOL II program. During normal end-of-day processing this file is deleted and the next day+s source jobs will update this file again. This REXX exec will display in a report format the total number of messages received per source and the GDG number created. A grand total is utilized to sum all sources to give a total number of messages received. Also a display line is used to show total number of sources processed during the day. Download this Exec in text format (SU95QT2-RUNS.TXT) /* REXX */ /************************************************************/ /* TURN USER PROFILE PREFIXS OFF */ /************************************************************/ whois = USERID(); X = MSG("OFF") ADDRESS TSO "PROFILE NOWTPMSG" "PROFILE NOPREFIX" /************************************************************/ /* POPULATE WORKING VARIABLES */ /************************************************************/ Runtime = TIME() Rundate = JUSTIFY(DATE(),11,'-') Today = DATE(S) total. = 0 /************************************************************/ /* MAIN ROUTINE */ /************************************************************/ Say " " Say " " Do CALL Get_Data CALL Display_GT End /************************************************************/ /* RESETTING USER PROFILE PREFIX BEFORE EXITING REXX */ /************************************************************/ X = MSG("ON") ADDRESS TSO "PROFILE PREFIX("whois")" Exit /*-------------------------------*/ /* C A L L S */ /*-------------------------------*/ /************************************************************/ /* THIS CALL WILL PULL DATA FROM DASD FILE */ /************************************************************/ Get_Data: Say 'Retrieving Totals - Please Wait' Say " " CNT410='PMGT.X.GTP410.CONTROL.TOTALS' 'ALLOC FI(INFILE) DA('CNT410') SHR REUSE' 'EXECIO * DISKR INFILE (FINIS' IF rc = 0 Then Do Say " " Say " " Say 'ERROR-ERROR-ERROR' Say 'ERROR READING INFILE...RETRY LATER' Say 'ANOTHER USER IS UPDATING THE INPUT FILE' Exit rc End CALL Display_Heading Do Queued() PULL Date 9 Source 13 Tot_Toll 22 Tot_Cabs 31 GT_Msgs 40 CALL Display_Data End "FREE FI(INFILE)" Return /************************************************************/ /* THIS CALL WILL DISPLAY REPORT HEADINGS */ /************************************************************/ Display_Heading: Say 'Run Date: ' Rundate ' ' 'Run Time: ', Runtime Say ' 410 CONTROL TOTALS QUERY ' Say " " Say ' TAPE TOTAL TOLL TOTAL CABS GRAND TOTAL GENERATION' Say ' SOURCE MESSAGES MESSAGES MESSAGES' Say " " Return /************************************************************/ /* THIS CALL WILL DISPLAY CONTROL TOTALS BY SOURCE ON SCREEN */ /************************************************************/ Display_Data: If Datatype(Date) = "NUM" Then Do total.runs = total.runs + 1 Say RIGHT(Source,10) RIGHT(STRIP(Tot_Toll,+L+,+0"),12), RIGHT(STRIP(Tot_Cabs,+L+,+0"),12), RIGHT(STRIP(GT_Msgs,+L+,+0"),15), RIGHT(total.runs,15) total.toll = total.toll + Tot_Toll total.cabs = total.cabs + Tot_Cabs total.gt = total.gt + GT_Msgs End Return /************************************************************/ /* THIS CALL WILL DISPLAY GRAND TOTALS */ /************************************************************/ Display_Gt: Say " " Say 'Grand Tots' RIGHT(total.toll,12) RIGHT(total.cabs,12), RIGHT(total.gt,15) Say " " Say "Total Number of 410's Ran on: " Today " is " total.runs Return INPUT "PMGT.X.GTP410.CONTROL.TOTALS" LRECL=47 01 CONTROL-TOTALS-REC. 05 CTR-CENTURY PIC 9(2). 05 CTR-RUNDATE PIC 9(6). 05 CTR-TOLL-CENTER PIC X(2). 05 CTR-TAPE-NUMBER PIC 9(2). 05 CTR-TOTAL-TOLL-MSGS PIC 9(9). 05 CTR-TOTAL-CABS-MSGS PIC 9(9). 05 CTR-GRAND-TOTAL-MSGS PIC 9(9). 05 CTR-GENERATION PIC X(8). |
|
||||||||
home · current
articles
· archives · forums · |