$! $! PLOTS.COM $! $! This procedure renames postscript plots created by VOYPROD $! software to render a time descriptive plot name. Standard $! 2 day plots are assumed (see hardwired increment of DAY $! variable). $! $! Expect Postscript plots to existence in root directory SYS$SCRATCH. $! Plots are created in forward time sequential order. Renamed plots $! are copied to the SYS$SCRATCH directory. $! $! Written by Sandy Kramer, HSTX, code 692, 06/13/96 $! Mod to correct reverse directory order name assignments 11/02/200 SBK $! $ ON CONTROL_Y THEN GOTO CLEAN $ ON ERROR THEN GOTO CLEAN $ WO :== WRITE SYS$OUTPUT $ SET DEF SYS$SCRATCH $ WO "" $ WO "Renaming plots ..." $ WO "" $! $ SUMMNAME = P1 $ WO "Seed name: ",SUMMNAME $ WO "" $ SCID = F$EXTRACT(0,2,SUMMNAME) $ IF SCID .NE. "V1" .AND. SCID .NE. "V2" THEN EXIT $ YEAR = F$EXTRACT(2,2,SUMMNAME) $ DAY = F$EXTRACT(4,3,SUMMNAME) $ DAY = F$INTEGER(DAY) $ HOUR = F$EXTRACT(7,2,SUMMNAME) $ HOUR = F$INTEGER(HOUR) $! $ DIRECTORY *.PS /COL=1 /NOHEAD /NOTRAIL /OUTPUT=OBJECT.DAT $ OPEN INFILE OBJECT.DAT $ CNT = 0 $ LOOP: $ CNT = CNT + 1 $ READ /END=END_LOOP INFILE REC $ DIR_POSITION = 'F$LOCATE(".PS",REC)' $ NAME_POSITION = 'F$LOCATE("]",REC)' + 1 $ LENGTH = DIR_POSITION - NAME_POSITION + 7 $ NAME := 'F$EXTRACT(NAME_POSITION,LENGTH,REC)' $ NAME'CNT' = NAME $ GOTO LOOP $ END_LOOP: $! $ NUM = CNT $ PLT = 0 $ RENAME: $ PLT = PLT + 1 $ NUM = NUM - 1 $ IF NUM .LT. 1 THEN GOTO ENDNAME $ IF HOUR .GT. 24 $ THEN $ DAY = DAY + 1 $ HOUR = HOUR - 24 $ ENDIF $ CDAY = DAY $ IF DAY .LT. 10 THEN CDAY = "00"'DAY' $ IF DAY .GE. 10 .AND. DAY .LT. 100 THEN CDAY = "0"'DAY' $ IF HOUR .LT. 10 THEN CHOUR = "0"'HOUR' $ NEWNAME = "SYS$SCRATCH:"'SCID''YEAR''CDAY''CHOUR'".PS" $ OLDNAME = NAME'PLT' $ WRITE SYS$OUTPUT "COPYING FILE ",OLDNAME," TO ",NEWNAME $ COPY 'OLDNAME' 'NEWNAME' $ DAY = DAY + 2 $ GOTO RENAME $ ENDNAME: $! $ CLEAN: $ CLOSE INFILE $ DELETE/NOCONFIRM OBJECT.DAT;* $ EXIT