Page 1 of 1

Elimination of Special Char. Using SORT.

Posted: Fri May 23, 2014 3:40 am
by Vikas.betu
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
//*
------------------------------------------------------------------------------------

Posted: Fri May 23, 2014 11:13 am
by William Collins
Have a look at ALTSEQ in your documentation.

Posted: Fri May 23, 2014 7:18 pm
by Vikas.betu
Hi William

Thanks
I am currently using ALTSEQ for replacing special characters. However I am not able to replace all the special char thats why I am want to try this.

so help me to use this for my requirement

Posted: Fri May 23, 2014 11:29 pm
by DikDude
Why do you believe you cannot change some of the values?

Every possible bit pattern (from x'00' thru x'FF') can be handled by ALTSEQ.

If you cannot, then there is some understanding that is missing.

Posted: Sat May 24, 2014 1:56 am
by Vikas.betu
Thanks Dick but do u have list bit pattern (from x'00' thru x'FF') for all special characters. If yes then please provide me the same. As I tried as much as I could but still there are some characters which are missing and I can't recognise the bit pattern (from x'00' thru x'FF') for them.
:( :(

Posted: Sun May 25, 2014 3:52 am
by NicC
Suggest you google 'ebcdic codes' - or, even easier, create a dataset using ispf edit with hex on with all codes from x'00' to x'ff'.

Posted: Mon May 26, 2014 7:54 pm
by dbzTHEdinosauer
depending upon the code set on your computer,
you are better off using NicC's second suggestion.
easiest would be to use the REXX XRANGE function and then write the output to a file and then view it.

Topic deleted by Admin

Posted: Fri Jan 15, 2016 8:22 pm
by academyindia4
<< Content deleted By Admin >>