Elimination of Special Char. Using SORT.

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
Vikas.betu
Member
Posts: 29
Joined: Tue Feb 18, 2014 9:13 pm

Elimination of Special Char. Using SORT.

Post by Vikas.betu » 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
//*
------------------------------------------------------------------------------------

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Fri May 23, 2014 11:13 am

Have a look at ALTSEQ in your documentation.

Vikas.betu
Member
Posts: 29
Joined: Tue Feb 18, 2014 9:13 pm

Post by Vikas.betu » Fri May 23, 2014 7:18 pm

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

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Fri May 23, 2014 11:29 pm

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.
Have a good one

Vikas.betu
Member
Posts: 29
Joined: Tue Feb 18, 2014 9:13 pm

Post by Vikas.betu » Sat May 24, 2014 1:56 am

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.
:( :(

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Sun May 25, 2014 3:52 am

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'.
Regards
Nic

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Mon May 26, 2014 7:54 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.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

academyindia4

Topic deleted by Admin

Post by academyindia4 » Fri Jan 15, 2016 8:22 pm

<< Content deleted By Admin >>

Post Reply

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



Other References
Mainframe Tools and others