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

Date conversation


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

New User


Joined: 22 Nov 2007
Posts: 64
Location: Germany

PostPosted: Fri Jul 16, 2021 1:20 pm
Reply with quote

Hi guys,

I need a special date output field from current date.

Input file :
Code:
PETER
GERALD


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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1231
Location: Bamberg, Germany

PostPosted: Fri Jul 16, 2021 1:37 pm
Reply with quote

Code:
p,m,Yxx,WEEKNUM={USA|ISO}
p,m,Yxx,WEEKDAY={CHAR3|CHAR9|DIGIT1}

See DFSORT manual.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2012
Location: USA

PostPosted: Fri Jul 16, 2021 4:52 pm
Reply with quote

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 824.gif
Back to top
View user's profile Send private message
oerdgie

New User


Joined: 22 Nov 2007
Posts: 64
Location: Germany

PostPosted: Fri Jul 16, 2021 5:03 pm
Reply with quote

Ups, sorry... my mistake icon_confused.gif

Nevertheless, I hope everybody understand my problem.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3049
Location: NYC,USA

PostPosted: Fri Jul 16, 2021 7:23 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1231
Location: Bamberg, Germany

PostPosted: Fri Jul 16, 2021 10:35 pm
Reply with quote

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
View user's profile Send private message
oerdgie

New User


Joined: 22 Nov 2007
Posts: 64
Location: Germany

PostPosted: Mon Jul 19, 2021 3:12 pm
Reply with quote

Ok, thanks for help !
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
Search our Forums:

Back to Top