REXX Convert Stck Date – SMF – to readable               goto homepage

Stck Datum – z.B. SMF – in “lesbaren” Format umstellen

 

/* REXX */                                               
/*------------------------------------------------------*/
/* Copyright 2005 YCOS Yves Colliard Software GmbH      */
/*------------------------------------------------------*/
/* */                                                    
"execio 1 diskr in (stem tl."                            
do while rc=0                                            
  if substr(tl.1,2,1)='1E'x then do                      
    time=substr(tl.1,3,4)                                
    timed=trunc(c2d(time)/100)                           
    sec=(timed//60)                                      
    timem=(timed%60)                                      
    min=(timem//60)                                      
    timeh=(timem%60)                                     
    hou=(timeh//60)                                      
    say "Rec:" c2x(substr(tl.1,2,1)),                    
        "Sub:" c2x(substr(tl.1,20,1)),                   
        y(hou)":"y(min)":"y(sec),                        
        substr(tl.1,211,32),                             
        StckCony(c2x(substr(tl.1,359,8))),               
        StckCony(c2x(substr(tl.1,359+8,8)))              
  end                                                    
  "execio 1 diskr in (stem tl."                          
end                                                      
"execio 0 diskr in (finis"                                
exit                                                     
y:                                                                    
return right("0"arg(1),2)                                             
/* */                                                                  
STCKCONY: Procedure                                                   
odig=digits()                                                         
Numeric  Digits 20              /* increase significant digits to 20 */
Secs     = X2D(SubStr(arg(1),1,13))     /* Ignore last 1.5 bytes     */
msec     = right("0000000"secs//1000000,6) /* micro secs   */         
times    = secs%1000000                                               
sec      = times//60                       /* seconds      */         
timem    = times%60                                                   
min      = timem//60                       /* minutes      */         
timeh    = timem%60                                                   
hours    = timeh//24                       /* hours        */         
timed    = (timeh%24)+date("B","19000101","S") /* days since 1900 */  
Numeric  Digits odig           /* restore default significant digits */
Return   date("E",timed,"B")" "y(Hours)":"y(Min)":"y(sec)"."msec