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

Search & Replace within a range of text


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

New User


Joined: 03 Oct 2006
Posts: 2

PostPosted: Tue Oct 03, 2006 1:14 am
Reply with quote

Hi,

I am trying to use DF Sort to perform a search and replace within a text string. The string is 80 characters long and I need to search and replace all line feed characters with spaces.

Any help gratefully appreciated.
Thanks!
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 Oct 03, 2006 1:43 am
Reply with quote

I'm not sure what the "line feed" character is. For purposes of the example, let's say it's X'25' (hex 25). You could use a DFSORT job like this to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  ALTSEQ CODE=(2540)
  OUTREC FIELDS=(1,80,TRAN=ALTSEQ)
/*


For more information on TRAN=ALTSEQ, see the "Change all zeros in your records to spaces " Smart DFSORT Trick at:

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

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
blocis

New User


Joined: 03 Oct 2006
Posts: 2

PostPosted: Tue Oct 03, 2006 2:09 am
Reply with quote

Thats exactly what I needed Frank.

Thanks for your awesome and speedy response!
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 Oct 03, 2006 2:30 am
Reply with quote

Glad I could 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 Replace each space in cobol string wi... COBOL Programming 2
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top