IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need Date in PD Format


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
guptah

New User


Joined: 08 Apr 2008
Posts: 5
Location: Gurgaon

PostPosted: Tue Jun 03, 2008 9:35 am
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
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Tue Jun 03, 2008 3:43 pm
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 Developer


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

PostPosted: Tue Jun 03, 2008 9:05 pm
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts InfoSphere OPTIM CSV ouput vs DSNTIUA... IBM Tools 3
Search our Forums:

Back to Top