*DEFINE GET_TS *. *. Returns a current timestamp as 17 characters in global variable TS. *. *. Use of this routine is preferable to coding multiple DATE$ or TIME$ *. SGS references because SSG fills each such reference by a separate *. ER and midnight might be crossed between ERs (causing an inaccurate *. timestamp). This routine avoids that problem (but see the restriction *. below) by comparing current time to SSG start-up time: If current time *. is less than SSG start-up time, then we've crossed midnight since SSG *. start-up and current date is used; otherwise, we have not crossed *. midnight since SSG start-up and that date is used. This guarantees *. that the CCYYMMDD and HHMMSS parts of the timestamp are synchronized. *. The TTT (milliseconds) part is treated as a random number, so it need *. not be synchronized with the other parts of the timestamp. *. *. Input parameters: *. None. *. *. Output: *. Global character variable TS in form 'CCYYMMDDHHMMSSTTT'. *. *. Restriction: *. Calling skeleton must not run for more than 24 hours (so do not use *. this routine in background runs). *. *. Programming Note: *. Variables internal to this routine contain double-underscores ('__') *. and are *REMOVEd prior to returning. *. *. *SET TS__TIME = '[TIME$,1,1,1]' . current time (HH:MM:DD) *SET TS__MS = '[TIME$,1,2,1,RSTR$,3]' . current milliseconds *. *IF [*TS__TIME] < [DATIME$,1,2,1] . if midnight crossed since SSG start-up *SET TS = '[DATE$,1,5,1]' . use current date *ELSE *SET TS = '[DATIME$,1,7,1]' . use SSG start-up date *ENDIF *. *SET TS = '[*TS][*TS__TIME,LSTR$,2][*TS__TIME,SUBSTR$,4,2][*TS__TIME,RSTR$,2]' *SET TS = '[*TS][*TS__MS]' . Append milliseconds *. *REMOVE VARIABLE TS__TIME *REMOVE VARIABLE TS__MS *. *ENDDEFINE,E