Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Need Date in PD Format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
guptah

New User


Joined: 08 Apr 2008
Posts: 5
Location: Gurgaon

PostPosted: Tue Jun 03, 2008 9:35 am    Post subject: Need Date in PD Format
Reply with quote

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
View user's profile Send private message
References
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 121
Location: Chennai

PostPosted: Tue Jun 03, 2008 3:43 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 4579
Location: San Jose, CA

PostPosted: Tue Jun 03, 2008 9:05 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1