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

Resolve date field YYYYMMDD in a file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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 Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Mar 13, 2008 9:17 pm
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 Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Aug 15, 2008 5:45 am
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:

Use [URL] BBCode for External Links
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top