View previous topic :: View next topic
|
Author |
Message |
guptah
New User
Joined: 08 Apr 2008 Posts: 5 Location: Gurgaon
|
|
|
|
Hello All,
I want to get the Current date in Header record. The date should be in PD format.
I used DATENS=(4MD) but it is giving the date in display format.
Kindly suggest a way to get Date in PD format. |
|
Back to top |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
Use this to get the date in the PD format. You will have to use the SEQNUM and a IF WHEN to add the date to the header record.
Code: |
OPTION COPY
INREC OVERLAY=(1,20,DATE1)
OUTREC BUILD=(1,20,21,8,ZD,TO=PD,LENGTH=6,52X)
|
PS: Assumed the output record LRECL is 80 |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
guptah,
You can use a DFSORT job like the following to do what you asked for. I assumed that your input file has RECFM=FB and LRECL=80, and that you want to overlay the P'yyyymmdd' date into positions 11-15, but you can change the job appropriately.
Note that you can use DATEP1 to get the P'yyyymmdd' date - you don't have to use DATE1 and convert it to PD as Manuneedhi K has shown.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=... output file (FB/80)
//SYSIN DD *
OPTION COPY
INREC IFOUTLEN=80,
IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(81,8,ZD,EQ,1),OVERLAY=(11:DATE1P))
/*
|
|
|
Back to top |
|
|
|