Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
REXX Date Routine Help (Julian to

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
gringgo

New User


Joined: 28 Apr 2006
Posts: 2
Location: Phoenix, AZ

PostPosted: Fri Apr 28, 2006 10:16 pm    Post subject: REXX Date Routine Help (Julian to
Reply with quote

I have a REXX program written by someone else that extracts data from the RACF database and lists several dates. The date format in the output file comes out as yy.ddd, which is a Julian and/or Ordinal date.

The error message listed below shows my attempt at converting to mm/dd/yy format.

Here is the code that I have so far.

IF VUSER = SUBSTR(TAB.LINE#,1,4) THEN DO
KUSER = SUBSTR(TAB.LINE#,6,8)
USER = SUBSTR(TAB.LINE#,6,8)
NAME = SUBSTR(TAB.LINE#,19,20)
CREATDT = SUBSTR(TAB.LINE#,65,6) {this gets me yy.ddd}
CREATED = DATE('J',CREATDT,'U') {hope to get mm/dd/yy}
END

Here is the error message:

49 +++ CREATED = DATE('J',CREATDT,'U')
IRX0040I Error running V100#WSD, line 49: Incorrect call to routine

The ultimate goal is to convert yy.ddd to yyyy/mm/dd.


Any assistance is greatly appreciated.

John
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Fri Apr 28, 2006 11:29 pm    Post subject: Re: REXX Date Routine Help (Julian to
Reply with quote

Code:

...
CREATYY  = SUBSTR(TAB.LINE#,65,2)                     
CREATDDD = SUBSTR(TAB.LINE#,68,3)                     
PARSE VALUE DATE('S',CREATYY||CREATDDD,'J') WITH CCYY 5 MM 7 DD         
CREATED = CCYY'/'MM'/'DD
...


1. A valid Julian date is defined as either YYDDD or CCYYDDD, without the dot.

2. You used the incorrect order for the DATE() function parameters. The required output date format is the first (and only required) parameter, followed by the input date, then by the input date format.
Back to top
View user's profile Send private message
gringgo

New User


Joined: 28 Apr 2006
Posts: 2
Location: Phoenix, AZ

PostPosted: Sat Apr 29, 2006 2:13 am    Post subject: Re: REXX Date Routine Help (Julian to
Reply with quote

superk,

Thank you for the reponse, but try as I may, I continue to get the same error. I put the code is as you stated and below is the outcome. I don't know why the '5' and '7' exist in the PARSE statement, but I also tried it without and received the same error.

52 +++ PARSE VALUE DATE('S',CREATYY||CREATDDD,'J') WITH CCYY 5 MM 7 DD
IRX0040I Error running V100#WSD, line 52: Incorrect call to routine


IF VUSER = SUBSTR(TAB.LINE#,1,4) THEN DO
KUSER = SUBSTR(TAB.LINE#,6,8)
USER = SUBSTR(TAB.LINE#,6,8)
NAME = SUBSTR(TAB.LINE#,19,20)
CREATYY = SUBSTR(TAB.LINE#,65,2)
CREATDDD = SUBSTR(TAB.LINE#,68,3)
PARSE VALUE DATE('S',CREATYY||CREATDDD,'J') WITH CCYY 5 MM 7 DD
CREATED = CCYY'/'MM'/'DD
END


John
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Sat Apr 29, 2006 2:32 am    Post subject: Re: REXX Date Routine Help (Julian to
Reply with quote

Try just

CREATED = DATE('S',CREATYY||CREATDDD,'J')

and then maybe you can just do some re-formatting on CREATED.

Otherwise, post some TRACE I output for this section of code.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us