Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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
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    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

Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
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: 7130
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us