Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date format 'U' 1

Status
Not open for further replies.

schtuffseeker

Technical User
Aug 22, 2002
11
US
I am trying to provide users with a way of converting dates from Julian to USA format and vice-versa.
All works well until I input a USA date and attempt to convert to Julian.
Below is some code

WHEN SUBSTR(INDATE,3,1) = "/" THEN DO
OGREG = INDATE
DOW = DATE("W", INDATE ,"U")
OJUL = DATE("J", INDATE ,"U")

The last statement fails showing "incorrect call to routine", yet DOW has the correct day-of-week.
I am running on Z/OS V1R6.
I was wondering if anyone had run accross this, and how they got around it.
 
Never mind, I found in a REXX manual that an input date is not allowed with the "J" format.
 
That's true, but there -is- a way around it:
Code:
parse value Date("S",usa_dt,"U") Date("D",usa_dt,"U") with,
            ccyymmdd             ddd  . 
parse var ccyymmdd  ccyy 5 
julian_7 = ccyy||ddd           /* 2005246 */

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Thanks Frank,
You saved me a the agony of writing an assembler or cobol module to convert.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top