|
View previous topic :: View next topic
|
| Author |
Message |
paduchuri
New User

Joined: 03 Jan 2011 Posts: 32 Location: Hyderabad
|
|
|
|
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 |
|
 |
vasanthz
Global Moderator

Joined: 28 Aug 2007 Posts: 1753 Location: Tirupur, India
|
|
|
|
Hi,
Welcome to the forum
Try this card,
| Code: |
OPTION COPY
OUTREC OVERLAY=(1:C'// SET SYSDATE=D',17:DATE1-1) |
Output:
| Code: |
| // SET SYSDATE=D20110102 |
|
|
| Back to top |
|
 |
paduchuri
New User

Joined: 03 Jan 2011 Posts: 32 Location: Hyderabad
|
|
|
|
Thank u vasanthz,
The code looks good except i require in the format YYMMDD not YYYYMMDD Any clue on this. |
|
| Back to top |
|
 |
singhju
New User

Joined: 01 Dec 2010 Posts: 25 Location: Gurgaon
|
|
|
|
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 |
|
 |
paduchuri
New User

Joined: 03 Jan 2011 Posts: 32 Location: Hyderabad
|
|
|
|
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 |
|
 |
singhju
New User

Joined: 01 Dec 2010 Posts: 25 Location: Gurgaon
|
|
|
|
| What is (YMD) here? I tried this but it didn't work for me. |
|
| Back to top |
|
 |
paduchuri
New User

Joined: 03 Jan 2011 Posts: 32 Location: Hyderabad
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
 |
|
|