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

Replacing multiple strings at different locations in a file


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

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Wed Oct 13, 2010 7:39 pm
Reply with quote

My file length is 120 characters.

My requirement is to change
1) the string @ location 12 from 'A1' to 'K7'
AND
2) the string @ location 43 from 'B1' to 'K8'


I used the following sort card.


Code:
//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(12,2,CH,EQ,C'A1'),OVERLAY=(12:C'K7'),
            IFTHEN=(WHEN=(43,2,CH,EQ,C'B1'),OVERLAY=(43:C'K8'))
/*



Result:
A1 is replacing with K7 successfully, since the first condition is satisfied, the second condition is not being processed and the record gets processed.

Please let me know how to achieve this requirement.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Oct 13, 2010 7:45 pm
Reply with quote

it may have something to do with the HIT=NEXT
look it up in the manual,
links are: www.ibm.com/support/docview.wss?rs=0&uid=isg3T7000080

or search the DFSORT forum for HIT. I remember somebody explaining how it works.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 13, 2010 8:34 pm
Reply with quote

Hello,

Read about HIT=NEXT. . .
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Wed Oct 13, 2010 9:25 pm
Reply with quote

thanks dbzTHEdinosauer & dick.
I got it now.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 13, 2010 9:59 pm
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

d
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 8
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
Search our Forums:

Back to Top