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

date -1 populating in yymmdd format


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

New User


Joined: 03 Jan 2011
Posts: 32
Location: Hyderabad

PostPosted: Mon Jan 03, 2011 4:27 pm
Reply with quote

Hi all,

i have trouble in populating the current day -1 in yymmdd format i use the below code but it throws error could anyone help me on this.

sort is dummy my requirement is just to populate the require date in file

OPTION COPY
OUTREC OVERLAY=(1:C'// SET SYSDATE=D',17:DATE=(YMD))

error :PARAMETER '17:DATE' IS UNIDENTIFIED

_________________
Thanks you
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1753
Location: Tirupur, India

PostPosted: Mon Jan 03, 2011 4:48 pm
Reply with quote

Hi,

Welcome to the forum icon_smile.gif

Try this card,
Code:
  OPTION COPY                                     
  OUTREC OVERLAY=(1:C'// SET SYSDATE=D',17:DATE1-1)



Output:
Code:
// SET SYSDATE=D20110102
Back to top
View user's profile Send private message
paduchuri

New User


Joined: 03 Jan 2011
Posts: 32
Location: Hyderabad

PostPosted: Mon Jan 03, 2011 6:07 pm
Reply with quote

Thank u vasanthz,

The code looks good except i require in the format YYMMDD not YYYYMMDD Any clue on this.
Back to top
View user's profile Send private message
singhju

New User


Joined: 01 Dec 2010
Posts: 25
Location: Gurgaon

PostPosted: Tue Jan 04, 2011 9:49 am
Reply with quote

Hi,

You can try this:

Code:

     OPTION COPY                                     
     INREC OVERLAY=(1:C'// SET SYSDATE=D',17:DATE1-1)
     OUTREC BUILD=(1:1,16,17:19,6)                   


Output:
Code:
// SET SYSDATE=D110103
Back to top
View user's profile Send private message
paduchuri

New User


Joined: 03 Jan 2011
Posts: 32
Location: Hyderabad

PostPosted: Tue Jan 04, 2011 3:25 pm
Reply with quote

Thanks Singhju,

i always have some confusion with dates

i am not sure if i can use like this correct me if i am wrong.

OPTION COPY
INREC OVERLAY=(1:C'// SET SYSDATE=D',17:DATE1-1=(YMD))
Back to top
View user's profile Send private message
singhju

New User


Joined: 01 Dec 2010
Posts: 25
Location: Gurgaon

PostPosted: Tue Jan 04, 2011 3:42 pm
Reply with quote

What is (YMD) here? I tried this but it didn't work for me.
Back to top
View user's profile Send private message
paduchuri

New User


Joined: 03 Jan 2011
Posts: 32
Location: Hyderabad

PostPosted: Tue Jan 04, 2011 4:00 pm
Reply with quote

Hi jitender,

Please see below for more information

DATE=(abcd)
specifies that the current date is to appear in the reformatted OUTFIL output records in the form 'adbdc', where a, b, and c indicate the order in which the month, day, and year are to appear and whether the year is to appear as two or four digits, and d is the character to be used to separate the month, day and year.
For a, b, and c, use M to represent the month (01-12), D to represent the day (01-31), Y to represent the last two digits of the year (for example, 04), or 4 to represent the four digits of the year (for example, 2004). M, D, and Y or 4 can each be specified only once. Examples: DATE=(DMY.) would produce a date of the form 'dd.mm.yy', which on March 29, 2004, would appear as '29.03.04'. DATE=(4MD-) would produce a date of the form 'yyyy-mm-dd', which on March 29, 2004, would appear as '2004-03-29'.

a, b, c, and d must be specified.

Thanks,
Pavan
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: Wed Jan 05, 2011 12:04 am
Reply with quote

Jitender,

DATE and DATEn have different syntax. See "z/OS DFSORT Application Programming Guide" for complete details. You can access all of the DFSORT books from:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Jan 05, 2011 12:59 am
Reply with quote

Jitender,

You can use the following DFSORT JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
DUMMY RECORD                                             
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                       
  INREC IFOUTLEN=80,                                     
  IFTHEN=(WHEN=INIT,BUILD=(C'// SET SYSDATE=D',DATE1-1)),
  IFTHEN=(WHEN=INIT,OVERLAY=(17:19,6,2X))               
//*
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Format data from multiple records usi... SYNCSORT 4
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
No new posts Sort card to know that creation date ... DFSORT/ICETOOL 10
No new posts Help with SORT - I need to validate d... DFSORT/ICETOOL 11
No new posts Date format correction using dfsort DFSORT/ICETOOL 3
Search our Forums:


Back to Top