View previous topic :: View next topic
|
Author |
Message |
oerdgie
New User
Joined: 22 Nov 2007 Posts: 64 Location: Germany
|
|
|
|
Hi guys,
I need a special date output field from current date.
Input file :
Output file :
Code: |
PETER 2021285
GERALD 2021285 |
Output date in this example :
2021 = current year
28 = current weeknum (ISO)
5 = current weekday
How can I do this ?
Thanks in advance for help ! |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1231 Location: Bamberg, Germany
|
|
|
|
Code: |
p,m,Yxx,WEEKNUM={USA|ISO}
p,m,Yxx,WEEKDAY={CHAR3|CHAR9|DIGIT1} |
See DFSORT manual. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2012 Location: USA
|
|
|
|
BTW,
“date conversation” stands for “Datum-Gespräch”
“date conversion” stands for “Datumsumwandlung”
- in case you plan to do a search in a document, or in Google |
|
Back to top |
|
|
oerdgie
New User
Joined: 22 Nov 2007 Posts: 64 Location: Germany
|
|
|
|
Ups, sorry... my mistake
Nevertheless, I hope everybody understand my problem. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3049 Location: NYC,USA
|
|
|
|
Add-on to Joerg's hint.
Code: |
//SORTIN DD *
12312021
//SORTOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFILE BUILD=(5,4,C': CURRENT YEAR',/,
1,8,Y4W,WEEKNUM=ISO,C': CURRENT WEEKNUM (ISO)',/,
1,8,Y4W,WEEKDAY=DIGIT1,C': CURRENT WEEKDAY') |
Output:
Code: |
********************************* TOP OF DATA **********************************
2021: CURRENT YEAR
52: CURRENT WEEKNUM (ISO)
6: CURRENT WEEKDAY
******************************** BOTTOM OF DATA ******************************** |
Converting date fields |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1231 Location: Bamberg, Germany
|
|
|
|
Depending on the amount of input data to be equipped, it might make sense to generate the timestamp as DFSORT symbol and use that in a second DFSORT step.
Other than that, we are intrigued to see your solution here. |
|
Back to top |
|
|
oerdgie
New User
Joined: 22 Nov 2007 Posts: 64 Location: Germany
|
|
|
|
Ok, thanks for help ! |
|
Back to top |
|
|
|