> 4) What is the proper way to get the CVT time zone?  What is obsolete
> and what is the way to do it nowadays?

Lindy, I received this REXX code from the TSO-REXX mailing list a few weeks
ago...

/* Courtesy Lionel B Dyck <[EMAIL PROTECTED]>, via the TSO-REX
   mailing list */

/* ===========================================================
|| We're gonna have a big number
*/
NUMERIC DIGITS 21

/* ===========================================================
|| Get current CVTLDTO
||   (Local Date Time Offset in STCK format))
*/
cvt     = C2d( Storage( D2x( 16 ), 4 ) )
cvttz   = C2d( Storage( D2x( cvt + 304 ), 4 ) )
cvtext2 = C2d( Storage( D2x( cvt + 328 ), 4 ) )
cvtldto = C2d( Storage( D2x( cvtext2 + 56 ), 8 ), 8 )

/* ===========================================================
|| Calc the current offset in hours and minutes
||    (work with absolute)
*/
absldto = Abs( cvtldto )
hours   = absldto % x2d("D693A400000" )
minutes = ( absldto % x2d("3938700000") ) // 60
/* ===========================================================
|| Correction to Round to nearest hour
*/
If minutes <> "00"  Then Do
   If minutes > 30 Then
       hours = hours + 1
   /* minutes = 00 */
End

/* ===========================================================
|| Format to ANSI standard X3.51-1975
*/
zone    = Right( hours, 2, "0" )Right( minutes, 2, "0" )
IF cvtldto < 0 THEN DO
  zone      = "-"zone
END
ELSE DO
 zone = "+"zone
END

/* ===========================================================
|| Reset
*/
NUMERIC DIGITS

RETURN zone



Best regards,
Mark Wheeler, 3M Company

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to