• Add a Comment
  • Edit
  • More Actions v
  • Quarantine this Entry

Comments (1)

1 AdrianSimcock commented Permalink

Hi Liam,

 
As an alternative the following REXX code can be added to a data set in your ISPF SYSPROC concatenation (I called it DISPSSI). Then DISPSSI can be entered next to the LMOD in a data set member list panel (same as your image above). The code uses LM services to get the SSI and then "reverses" the SSI value back to the date and time.
 
Adrian Simcock
 
/* REXX */
/* Sample code to 'reverse' the RTC SSI timestamp. Adrian Simcock */
Arg data
Address ISPEXEC
data = Strip(data,'B',"'")
Parse Var data dsn '(' member ')' .
"LMINIT DATAID(DIDO) DATASET('"||dsn||"') ENQ(SHRW)"
'LMOPEN DATAID('DIDO') OPTION(INPUT)'
'LMMFIND DATAID('DIDO') MEMBER('member') STATS(YES)'
 
If Datatype(ZLSSI,'X') Then Do
Call ConvSeconds(ZLSSI)
End
 
Exit
/*-------------------------------------------------------------------------*/
/* Routine to convert hex SSI value to date/time. The assumption is the SSI*/
/* value is the number of seconds since 1st Jan 1970. */
/*-------------------------------------------------------------------------*/
ConvSeconds:Procedure
Arg InputSeconds
Numeric digits 12
DecSeconds = X2D(InputSeconds)
 
Leap = 366*24*60*60
NonLeap = 365*24*60*60
TheYear = 1970
 
Do While DecSeconds >= NonLeap
If TheYear // 4 = 0 Then
DecSeconds = DecSeconds - Leap
Else
DecSeconds = DecSeconds - NonLeap
TheYear = TheYear + 1
End
 
Month.1 = 31
Month.2 = 28
Month.3 = 31
Month.4 = 30
Month.5 = 31
Month.6 = 30
Month.7 = 31
Month.8 = 31
Month.9 = 30
Month.10 = 31
Month.11 = 30
Month.12 = 31
 
If (TheYear) // 4 = 0 Then
Month.2 = 29
 
Do i = 1 to 12
If DecSeconds < ((Month.i)*24*60*60) Then Do
TheMonth = i
i = 99
End
Else
DecSeconds = DecSeconds - ((Month.i)*24*60*60)
End
 
TheMonth = Right(TheMonth,2,'0')
TheDay = DecSeconds % (24*60*60)
DecSeconds = DecSeconds - (TheDay*24*60*60)
TheDay = TheDay + 1
 
TheDay = Right(TheDay,2,'0')
TheHour = Right(DecSeconds % (60*60),2,'0')
DecSeconds = DecSeconds - (TheHour*60*60)
TheMinute = Right(DecSeconds % 60,2,'0')
DecSeconds = DecSeconds - (TheMinute*60)
DecSeconds = Right(DecSeconds,2,'0')
Say 'SSI date is' TheYear'/'TheMonth'/'TheDay TheHour":"TheMinute":"DecSeconds
Return

Add a Comment Add a Comment