Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

date -1 populating in yymmdd format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: date -1 populating in yymmdd format
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: 1497
Location: Chennai

PostPosted: Mon Jan 03, 2011 4:48 pm    Post subject:
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    Post subject: Reply to: date -1 populating in yymmdd format
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    Post subject:
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    Post subject: Reply to: date -1 populating in yymmdd format
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Wed Jan 05, 2011 12:04 am    Post subject:
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:

http://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    Post subject:
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    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 Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us