Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* rexx */
- VOLSER='Z1DBMR'
- CALL FIND
- SAY TAPENAME SEQ
- EXIT 0
- /* MAIN FIND PROC */
- FIND: PROCEDURE EXPOSE VOLSER TAPENAME SEQ
- /* FINDING VOLSER */
- /* cutting disk name */
- DSNLOG=SYSDSN("'SOFT.SUPPORT("VOLSER")'")
- /* CHECKING IF DISK NAME IS EXIST IN SOFT SUPPORT */
- IF DSNLOG='OK' THEN
- DO
- "alloc da('SOFT.SUPPORT("VOLSER")') F(INPUT) shr reuse"
- "execio * diskr INPUT (stem VOL. finis"
- "FREE F(INPUT)"
- TAPENAME=SUBSTR(VOL.3,57,6)
- /* IF TEMP FILE(LIB1) EXIST */
- /* THEN DELETE IT */
- if sysdsn("'LIB1'")='OK' THEN
- DO
- ADDRESS TSO "DELETE 'LIB1'"
- END
- /* LISTING OUT ALL FILES FROM THE TAPE: */
- "HSEND LIST DUMPVOLUME("TAPENAME") ODS('LIB1')"
- /* FINDiNG PROCESS */
- /* WAITING FOR PREVIOUS FREE F() */
- ADDRESS SYSCALL 'sleep 1'
- "alloc da('lib1') F(indd) shr reuse"
- "execio * diskr indd (stem strings. finis"
- "free f(indd)"
- /* P - VARIABLE FOR INCREMENTING STEMS AND CHECKING FIND RESULT */
- P=0
- DO I=1 TO STRINGS.0
- IF INDEX(STRINGS.I,' 'VOLSER' ') /= 0 THEN
- DO
- P=P+1
- STRS.0=P
- STRSFULL.0=P
- STRS.P=SUBSTR(STRINGS.I,25,3)
- STRSFULL.P=STRINGS.I
- END
- END
- IF P /= 0 THEN
- DO
- IF P>1 THEN
- DO
- /* SETTING UP 1ST LINE AS INITIAL YYYY/MM/DD */
- Y=SUBSTR(STRSFULL.1,50,4)
- M=SUBSTR(STRSFULL.1,55,2)
- D=SUBSTR(STRSFULL.1,58,2)
- SEQ=SUBSTR(STRSFULL.1,25,3)
- DO I=2 TO STRS.0
- IF SUBSTR(STRSFULL.I,50,4)>Y THEN
- DO
- Y=SUBSTR(STRSFULL.I,50,4)
- M=SUBSTR(STRSFULL.I,55,2)
- D=SUBSTR(STRSFULL.I,58,2)
- SEQ=SUBSTR(STRSFULL.I,25,3)
- END
- ELSE
- IF SUBSTR(STRSFULL.I,50,4)=Y THEN
- DO
- IF SUBSTR(STRSFULL.I,55,2)>M THEN
- DO
- M=SUBSTR(STRSFULL.I,55,2)
- D=SUBSTR(STRSFULL.I,58,2)
- SEQ=SUBSTR(STRSFULL.I,25,3)
- END
- ELSE
- IF SUBSTR(STRSFULL.I,55,2)=M THEN
- DO
- IF SUBSTR(STRSFULL.I,58,2)>D THEN
- DO
- D=SUBSTR(STRSFULL.I,58,2)
- SEQ=SUBSTR(STRSFULL.I,25,3)
- END
- END
- END
- END
- SEQ=SEQ*1
- /* SAY 'LAST DATE:'||Y||'/'||M||'/'||D||' */
- RETURN 1
- /* MUL 1 FOR REFORMAT 003 ==> 3 */
- END
- ELSE
- DO
- SEQ=SUBSTR(STRSFULL.1,25,3)*1
- RETURN 1
- END
- END
- ELSE
- EXIT 0
- END
- ELSE
- DO
- SAY VOSLER 'NOT FOUND ON SOFT.SUPPORT'
- RETURN 0
- END
- EXIT 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement