Elimination of Special Char. Using SORT.
Posted: Fri May 23, 2014 3:40 am
Hi
I found below mention code to eliminate special char by using sort. But I am failed to change it as per my requirement. In this code we are passing data and creating 2 different files.
Requirement: I have a file of 350 record length and I need to replace all the special char with spaces or blanks. Could you please help me out to do this.
--------------------------------------------------------------------------------------
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABCDERT123456eeefghnkl9876MMOP
ABCDFRGT'MN,34567iolkmn..OOPMQ
POLMNB'123456789opnmcb
//FILEA DD SYSOUT=*
//FILEB DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,80,SS,EQ,C'`',OR,1,80,SS,EQ,C'`',OR,
1,80,SS,EQ,C'!',OR,1,80,SS,EQ,C'@',OR,
1,80,SS,EQ,C'#',OR,1,80,SS,EQ,C'$',OR,
1,80,SS,EQ,C'%',OR,1,80,SS,EQ,C'¢',OR,
1,80,SS,EQ,C'&',OR,1,80,SS,EQ,C'*',OR,
1,80,SS,EQ,C'(',OR,1,80,SS,EQ,C')',OR,
1,80,SS,EQ,C'_',OR,1,80,SS,EQ,C'-',OR,
1,80,SS,EQ,C'+',OR,1,80,SS,EQ,C'=',OR,
1,80,SS,EQ,C'¬',OR,1,80,SS,EQ,C'{',OR,
1,80,SS,EQ,C'¦',OR,1,80,SS,EQ,C'}',OR,
1,80,SS,EQ,C'\',OR,1,80,SS,EQ,C'/',OR,
1,80,SS,EQ,C'|',OR,1,80,SS,EQ,C';',OR,
1,80,SS,EQ,C'[',OR,1,80,SS,EQ,C']',OR,
1,80,SS,EQ,C':',OR,1,80,SS,EQ,C',',OR,
1,80,SS,EQ,C'<',OR,1,80,SS,EQ,C'>',OR,
1,80,SS,EQ,C'.',OR,1,80,SS,EQ,C'?',OR,
1,80,SS,EQ,C'"',OR,1,80,SS,EQ,C'''',OR,
1,80,SS,EQ,C'^',OR,1,80,SS,EQ,X'05'),
OVERLAY=(81:C'B'))
OUTFIL FNAMES=FILEA,BUILD=(1,80),INCLUDE=(81,1,CH,EQ,C' ')
OUTFIL FNAMES=FILEB,BUILD=(1,80),SAVE
//*
------------------------------------------------------------------------------------
I found below mention code to eliminate special char by using sort. But I am failed to change it as per my requirement. In this code we are passing data and creating 2 different files.
Requirement: I have a file of 350 record length and I need to replace all the special char with spaces or blanks. Could you please help me out to do this.
--------------------------------------------------------------------------------------
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABCDERT123456eeefghnkl9876MMOP
ABCDFRGT'MN,34567iolkmn..OOPMQ
POLMNB'123456789opnmcb
//FILEA DD SYSOUT=*
//FILEB DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,80,SS,EQ,C'`',OR,1,80,SS,EQ,C'`',OR,
1,80,SS,EQ,C'!',OR,1,80,SS,EQ,C'@',OR,
1,80,SS,EQ,C'#',OR,1,80,SS,EQ,C'$',OR,
1,80,SS,EQ,C'%',OR,1,80,SS,EQ,C'¢',OR,
1,80,SS,EQ,C'&',OR,1,80,SS,EQ,C'*',OR,
1,80,SS,EQ,C'(',OR,1,80,SS,EQ,C')',OR,
1,80,SS,EQ,C'_',OR,1,80,SS,EQ,C'-',OR,
1,80,SS,EQ,C'+',OR,1,80,SS,EQ,C'=',OR,
1,80,SS,EQ,C'¬',OR,1,80,SS,EQ,C'{',OR,
1,80,SS,EQ,C'¦',OR,1,80,SS,EQ,C'}',OR,
1,80,SS,EQ,C'\',OR,1,80,SS,EQ,C'/',OR,
1,80,SS,EQ,C'|',OR,1,80,SS,EQ,C';',OR,
1,80,SS,EQ,C'[',OR,1,80,SS,EQ,C']',OR,
1,80,SS,EQ,C':',OR,1,80,SS,EQ,C',',OR,
1,80,SS,EQ,C'<',OR,1,80,SS,EQ,C'>',OR,
1,80,SS,EQ,C'.',OR,1,80,SS,EQ,C'?',OR,
1,80,SS,EQ,C'"',OR,1,80,SS,EQ,C'''',OR,
1,80,SS,EQ,C'^',OR,1,80,SS,EQ,X'05'),
OVERLAY=(81:C'B'))
OUTFIL FNAMES=FILEA,BUILD=(1,80),INCLUDE=(81,1,CH,EQ,C' ')
OUTFIL FNAMES=FILEB,BUILD=(1,80),SAVE
//*
------------------------------------------------------------------------------------