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

How to remove special characters(X'0D' and X'25')?


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

New User


Joined: 25 Oct 2007
Posts: 16
Location: mumbai

PostPosted: Tue Jul 22, 2008 2:25 pm
Reply with quote

Hi,

I have an input file of LRECL=1000,RECFM= FB
It contains special characters/carriage return characters like X'0D' and X'25'

They can appear anywhere in the file.I need to replace these charactes with spaces.

I tried with this jcl and it worked but in two passes

Code:

//STEP1   EXEC  PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=filea.input  --> File containing special characters
//            DISP=SHR                                     
//SORTOUT  DD DSN=fileb.output,             
//            DISP=(NEW,CATLG,DELETE),                     
//            UNIT=SYSDA,                                   
//            SPACE=(CYL,(50,50),RLSE)                     
//SYSIN DD *                                               
  OPTION COPY                                               
  ALTSEQ CODE=(2540)                                       
  OUTREC FIELDS=(1,1000,TRAN=ALTSEQ)                       
/*                                                         
//*                                                         
//STEP2   EXEC  PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=fileb.output,
//            DISP=SHR                                     
//SORTOUT  DD DSN=filec.output,
//            DISP=(NEW,CATLG,DELETE),                     
//            UNIT=SYSDA,                                   
//            SPACE=(CYL,(50,50),RLSE)                     
//SYSIN DD *                                               
  OPTION COPY                                               
  ALTSEQ CODE=(0D40)                                       
  OUTREC FIELDS=(1,1000,TRAN=ALTSEQ)                       
/*                                                         
//*


Is it possible to remove the special characters(X'0D' and X'25') in one single pass?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Jul 22, 2008 3:33 pm
Reply with quote

Hi,

just code it as

Code:

   ALTSEQ CODE=(2540,0D40)


Gerry
Back to top
View user's profile Send private message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Tue Jul 22, 2008 3:37 pm
Reply with quote

Code:

  OPTION COPY                                               
  ALTSEQ CODE=(2540,0D40)                                       
  OUTREC FIELDS=(1,1000,TRAN=ALTSEQ)     
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 Jul 22, 2008 9:45 pm
Reply with quote

atchuta konduri,

Since you knew you could use the ALTSEQ statement to set up one pair of characters, I'm surprised you didn't just look up the ALTSEQ statement in the DFSORT books to see if it could do more. The DFSORT books are all available online at:

Use [URL] BBCode for External Links
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 Jul 29, 2008 4:23 am
Reply with quote

With z/OS DFSORT V1R5 PTF UK90013 (July, 2008), you can now use DFSORT's new FINDREP function to do this kind of thing a bit more easily. For example:

Code:

  OPTION COPY                                               
  INREC FINDREP=(IN=(X'25',X'0D'),OUT=C' ')


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 Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Remove leading zeroes SYNCSORT 4
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts Count the number of characters in a f... CA Products 1
Search our Forums:

Back to Top