View previous topic :: View next topic
|
Author |
Message |
dsivapradeep
New User
Joined: 06 Jul 2012 Posts: 43 Location: INDIA
|
|
|
|
Hi,
I want to convert the part of the header from one datatype to another while adding the header itself.
Below is the snippet, but this is not working .
Please suggest on the same.
HEADER1=(1:C'00000000',9:DATENS=(4MD),ZD,TO=PD,LENGTH=5)
The code ZD,TO=PD,LENGTH=5 won't work? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Perhaps your can post your full code and describe what you are trying to do?
HEADER1 is a reporting function. |
|
Back to top |
|
|
dsivapradeep
New User
Joined: 06 Jul 2012 Posts: 43 Location: INDIA
|
|
|
|
I want to insert header with first 8 charectors as 0's(this I have taken care) and next 5 charectors should contain date(YYYYMMDD) converted in PD format.
I'm not able to code inserting date part. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
HEADER1 is a reporting function. Packed-decimal on a report is useless. So you can't do it.
Since you give no further clues...
If you are desperate for the date to be packed, extend your record, temporarily, in the correct place, depending of fixed- or variable-length records, by adding a sequence number which is long enough to hold a unique count for all your records. In OUTFIL, test the count. If it is your starting number (one by default) use / (slash operator) to output your header before your first data record. Remember to remove the sequence number in OUTFIL with BUILD. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
what is the reason to have the sticky flag on a topic of so little interest ? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Good question, enrico. It wasn't earlier. Fixing, but not sure how it got that way. I checked and can't see that I accidently did it with my posts (can't see an option) and I didn't edit the question :-) |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
You can use DATE1P which produces the current in PD format. However it is not available on the reporting feature such as header1. So you just need to put it at the end of record and then chop it off while writing it out.
Ex: If your input has LRECL = 80 and RECFM = FB you can use the following JCL
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
A
B
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(81:DATE1P)
OUTFIL REMOVECC,BUILD=(1,80),
HEADER1=(8C'0',81,5)
//* |
|
|
Back to top |
|
|
|