Elimination of Special Char. Using SORT.
Moderators: Frank Yaeger, Moderator Group
-
- Member
- Posts: 29
- Joined: Tue Feb 18, 2014 9:13 pm
Elimination of Special Char. Using SORT.
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
//*
------------------------------------------------------------------------------------
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Member
- Posts: 29
- Joined: Tue Feb 18, 2014 9:13 pm
-
- Member
- Posts: 29
- Joined: Tue Feb 18, 2014 9:13 pm
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
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.
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.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page