View previous topic :: View next topic
|
Author |
Message |
Rohini 3114
New User
Joined: 02 Jul 2021 Posts: 2 Location: India
|
|
|
|
I have a situation like whenever I run that sort I should get the current timestamp - 1 monthin the format 'yyyymmdd'
Eg. If I run the job today (2021/07/01) I should get as (2021/06/01)
please help me out. thanks in advance.[/quote] |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1305 Location: Bamberg, Germany
|
|
|
|
Code: |
//WHATEVER EXEC PGM=SORT
//SORTIN DD *
2021/07/02
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:1,10,UFF,M10,LENGTH=8,
1:81,8,Y4T,SUBMONS,+1,TOGREG=Y4T(/)))
END
/* |
|
|
Back to top |
|
|
Rohini 3114
New User
Joined: 02 Jul 2021 Posts: 2 Location: India
|
|
|
|
Got the output as 9999/99/99 in this format |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1305 Location: Bamberg, Germany
|
|
|
|
Have you tried the exact job as I have posted? It works perfectly fine on my site even for a 2021/03/31 date. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2115 Location: USA
|
|
|
|
Rohini 3114 wrote: |
Got the output as 9999/99/99 in this format |
100% - your input date format doesn't match the format you declared in you SORT statements.
You SHOULD be able to understand this type of errors by yourself.
BTW: you refuse to present any part of your own code; it is nasty.
Either change your SORT statements, or correct your input data. Nothing else to discuss at the forum when you are trying to hide any information on your code. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1305 Location: Bamberg, Germany
|
|
|
|
sergeyken wrote: |
100% - your input date format doesn't match the format you declared in your SORT statements. |
I definitely would agree. The given code is tested against SYNCSORT and DFSORT, I always test my stuff before posting. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3075 Location: NYC,USA
|
|
|
|
Rohini 3114 wrote: |
I have a situation like whenever I run that sort I should get the current timestamp - 1 monthin the format 'yyyymmdd'
Eg. If I run the job today (2021/07/01) I should get as (2021/06/01)
please help me out. thanks in advance. |
Please search before posting , its simple task and discussed on this forum many a times. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1305 Location: Bamberg, Germany
|
|
|
|
What makes it so hard to avoid excessive tags? There is a preview button.. |
|
Back to top |
|
|
|