View previous topic :: View next topic
|
Author |
Message |
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
hi,
is there any way i can convert number of days to date through jcl?
i need the date in ISO FORMAT.i searched the forum but did not help
Regds,
useit |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hello,
Sounds like a Julian date to X date format conversion.
Show us the input and output records. Someone will be able to help. |
|
Back to top |
|
|
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
from HF to ISO format.
for example input is +11881
after converting it should be 2012-07-12
Regds,
useit |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
Back to top |
|
|
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
hi we have ICE201I H record type
Regds,
useit |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
useit wrote: |
from HF to ISO format.
for example input is +11881
after converting it should be 2012-07-12
Regds,
useit |
This suggests that you're getting data from a toy computer with an epoch of 1 January 1980? |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hello try this,
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
11881
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFOUTLEN=80,
IFTHEN=(WHEN=INIT,OVERLAY=(81:C'01011980')),
IFTHEN=(WHEN=INIT,OVERLAY=(01:81,8,Y4W,ADDDAYS,1,5,ZD,
TOGREG=Y4T(-)))
//* |
Output:
I dont know what HF format is. -11881 pointed to Jan 1 1980. So assumed that dates begin from Jan 1 1980 |
|
Back to top |
|
|
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
vasanth,
correct the date begins from 1 January 1980.how did you say that 11881 is pointing at jan 1 1980?
thanx for your solution.i got confused with the input date format.
Regds,
useit |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hello,
This SAS program told that -11881 was 01 Jan 1980.
Code: |
data _null_;
now = today() - 11881;
put now ddmmyy10.;
run; |
output: 01/01/1980 |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I can't test it at the moment, but you could perhaps try defining a SYMNAME for the literal, rather than adding the literal to the end of the record.
Might not make much nevermind with one record, but as a bonus it removes the need to know where to extend the data with VB vs FB. Can have a nice descriptive name as well. OLDTOYCOMPUTERSTARTDATE or something even better... |
|
Back to top |
|
|
|