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
 

 

Replacing special characters with spaces in a file.

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

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Wed Sep 12, 2007 12:46 pm    Post subject: Replacing special characters with spaces in a file.
Reply with quote

Hi,

i have special characters in input file .can you replace them with spaces.
only A to z and 0 to 9 are acceptable in my input records.

ex:
input:

012130*&12*345
*23234*4545*34
o2313)(ewwdsds

output:
012130 12 345
23234 4545 34
02313 ewwdsds

can we do this in SORT?

thanks & regards,
avaneendra.
Back to top
View user's profile Send private message

ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Wed Sep 12, 2007 4:33 pm    Post subject:
Reply with quote

Hi avaneendra_linga,

Do you have a list of special characters that could appear in your input file? The DFSORT job written below replaces special characters mentioned in your sample input. If you have special characters other than those you need to modify the job.

The JCL given below uses ALTSEQ. You can read more about it in "DFSORT Getting Started.pdf" available in this forum.

Code:

//STEP1   EXEC PGM=SORT                 
//SORTIN  DD *                           
012130*&12*345                           
*23234*4545*34                           
O2313)(EWWDSDS                           
//SORTOUT DD SYSOUT=*                   
//SYSOUT  DD SYSOUT=*                   
//SYSIN   DD *                           
     OPTION COPY                         
     ALTSEQ CODE=(5C40,5040,4D40,5D40)   
     OUTREC FIELDS=(1,80,TRAN=ALTSEQ)   
/*                                       



Output :
Code:

012130  12 345
 23234 4545 34
O2313  EWWDSDS


--Parag
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: Wed Sep 12, 2007 8:22 pm    Post subject:
Reply with quote

avaneendra,

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

http://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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Wed Sep 12, 2007 9:34 pm    Post subject:
Reply with quote

Hello avaneendra,

When there are multiple consecutive special characters (csc's) in the input data, do you want one space or as many spaces as there are csc's in the output?

Your example shows one space, but the suggested solution will create multiple consecutive spaces.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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