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
 

 

Resolve date field YYYYMMDD in a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vel2k8

New User


Joined: 10 Jun 2005
Posts: 11
Location: Jacksonville

PostPosted: Thu Mar 13, 2008 3:16 pm    Post subject: Resolve date field YYYYMMDD in a file
Reply with quote

Frank

I want to reolve all the string fields YYYYMMDD inside a file with todays date. (or DATE1-1. ie yesterday)

YYYYMMDD may occur many times in the input file and may not be in the same column.

Sample Input file.

AAA_YYYYMMDD_123
123_TRS_YYYYMMDD_RTS_YYYYMMDD

Output Expected

AAA_20080313_123
123_TRS_20080313_RTS_20080313

I need this card to be generic so that I can have a similar card to replace YYYYMMDD with yesterdays date and so on.. (Like DATE1-1 or DATE1-2 etc. ) Because my job will be running on week ends and need to process monday to Friday files. ie, for monday file I need to replace YYYYMMDD with today - 5 days and so on assuming my job will run on saturday.

Vel.
Back to top
View user's profile Send private message

vel2k8

New User


Joined: 10 Jun 2005
Posts: 11
Location: Jacksonville

PostPosted: Thu Mar 13, 2008 3:26 pm    Post subject: Reply to: Resolve date field YYYYMMDD in a file
Reply with quote

Forgot to tell you one thing, my installation doesnot have DFSORT Symbol
facility

Thanks
Vel.
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: Thu Mar 13, 2008 9:17 pm    Post subject:
Reply with quote

Quote:
my installation does not have DFSORT Symbol


This statement makes no sense. If you have DFSORT, then you have DFSORT Symbols.

You could use a set of IFTHEN statements to do this. How many depends on the last position in which YYYYMMDD can be found in any record. It's not clear if the example records you show are the actual records or if the actual records can have a YYYYMMDD further out in the record.
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: Fri Aug 15, 2008 5:45 am    Post subject:
Reply with quote

You can do this kind of thing quite easily now with DFSORT's new FINDREP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(C'TDATE,''',DATE1-1,C'''',80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD *
AAA_YYYYMMDD_123
123_TRS_YYYYMMDD_RTS_YYYYMMDD
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC FINDREP=(IN=C'YYYYMMDD',OUT=TDATE)
/*


You can substitute DATE1 or DATE1-2 or whatever you need for DATE1-1 in the first INREC statement.

For complete details on the new FINDREP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm


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