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

Is find and replace possible?


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

Active User


Joined: 04 Oct 2006
Posts: 118
Location: NJ, USA

PostPosted: Mon Jan 08, 2007 9:50 pm
Reply with quote

Hi,
I have a File A - many records - Its FB , lrecl=183
Code:
AAAA12-31-9999yyyy98.8908
AAAA02-18-2006vterg98.8908
AAAA10-10-2006yyyy98.8908


and FILE B only one record, it is FB, Lrecl = 378
Code:
BBBByunheea098798YBGT01-01-2007y657980.00


I want to find the date
Code:
12-31-9999
from FILE A and replace it with the date from FILEB
Code:
01-01-2007
.
Is there any way to do it in a JCL? pls help
Thanks,
Viji
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jan 08, 2007 10:15 pm
Reply with quote

Is the date location in FILE A always the same?
Do you have DFSORT?
Back to top
View user's profile Send private message
vijikesavan

Active User


Joined: 04 Oct 2006
Posts: 118
Location: NJ, USA

PostPosted: Mon Jan 08, 2007 10:28 pm
Reply with quote

Yes. the location of the date field in both the files are always same.
Yes I have DFSORT.
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: Mon Jan 08, 2007 10:55 pm
Reply with quote

Viji,

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input fileB (FB/378)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  OUTREC FIELDS=(C'Newdate,C''',22,10,C'''',80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input fileA (FB/183)
//SORTOUT DD DSN=... output file (FB/183)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(5,10,CH,EQ,C'12-31-9999'),
    OVERLAY=(5:Newdate))
/*
Back to top
View user's profile Send private message
vijikesavan

Active User


Joined: 04 Oct 2006
Posts: 118
Location: NJ, USA

PostPosted: Tue Jan 09, 2007 12:17 am
Reply with quote

Thanks Frank.
It worked out fine. I was not aware of OVERLAY function using literal substitutes. Can you sugesst me any link to read more about these features.
Thanks,
Viji
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: Tue Jan 09, 2007 1:43 am
Reply with quote

You can read about all of the DFSORT features introduced in Dec, 2004 at:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/

You can read about all of the DFSORT features introduced in April, 2006 at:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/

Additionally, all of these features are documented in the DFSORT books available at:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
Search our Forums:

Back to Top