Hi Clark,
There is a easier way to find out the invalid records. Here is a JCL
which will split the records into 2 files, the good and bad. We
essentially copy the entire record at the end and then use FINDREP to
replace the known characters (A thru Z and 0-9). We will then only be
left is the invalid/special characters. I assumed that your input has an
LRECL=80 and RECFM=FB. If your input file is variable block file, the job
will be slightly different.
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 GOOD RECORD
AB$DEFGHIJKLMNOPQRSTUVWXYZ0123456789 BAD RECORD FOR $
^BCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 BAD RECORD FOR ^
//GOODREC DD SYSOUT=*
//BADREC DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:1,80)),
IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=81,
IN=(C'A',C'B',C'C',C'D',C'E',C'F',C'G',C'H',C'I',C'J',C'K',
C'L',C'M',C'N',C'O',C'P',C'Q',C'R',C'S',C'T',C'U',C'V',
C'W',C'X',C'Y',C'Z',C'0',C'1',C'2',C'3',C'4',C'5',C'6',
C'7',C'8',C'9'),OUT=C''))
OUTFIL FNAMES=BADREC,BUILD=(1,80),INCLUDE=(81,1,CH,GT,C' ')
OUTFIL FNAMES=GOODREC,BUILD=(1,80),SAVE
//*
Further if you have any questions please let me know
Thanks,
Kolusu
DFSORT Development
IBM Corporation
IBM Mainframe Discussion List <[email protected]> wrote on
04/03/2013 06:35:53 PM:
> From: Clark F Morris <[email protected]>
> To: [email protected],
> Date: 04/03/2013 06:36 PM
> Subject: Re: Character Table to Match ISPF - COBOL or DFSORT?
> Sent by: IBM Mainframe Discussion List <[email protected]>
>
> On Wed, 3 Apr 2013 20:42:52 +0000 (UTC), [email protected] () wrote:
> The following was posted on comp.lang.cobol and is copied to ibm-main
> listserv for further comment. ibm-main is mirrored to the newsgroup
> bit.listserv.ibm-main.
>
> >
> >My current client is a utility. Which utility is not relevant; imagine
> >that they deal in whale-oil.
> >
> >Someone will look at me and say 'You have to remember what IBM
mainframe
> >programming was like in 1973.'
> >
> >I will respond 'IKFCBL00'.
> >
> >Someone will look at me and say 'This was brought up during Y2K
> >remediation but the Corner Office said to let it slide.'
> >
> >I will respond 'So this has been known and not addressed for a
> >decade-and-a-half. Maybe now it is time.'
> >
> >Anyhow... there's garbage in fields that are treated as character. An
> >example is a street-address which will read 'Unit #(char)', where '#'
is
> >an octothorpe (EBCDIC X'7B') and (char) is X'B0'.
> >
> >The codepage used is IBM CPGID 00037. X'B0' translate to a caret (or a
> >circumflex without an underlying vowel). The most ready conclusion is
> >that someone was keying in the digit '6' and still had the shift-key
> >depressed from the preceding octothorpe (shift-3).
> >
> >According to the code-page's spec (C-H 3-32220-050) a caret is a valid
> >character. When the dataset is browsed or viewed in ISPF the command
'f
> >p'.'' brings the cursor to X'B0'.
> >
> >The client agrees with browse/view/edit and has asked for records
> >containing 'invalid hex' to be written to a separate dataset. Right
now
> >I'm working with DFSORT but next week a COBOL solution may be
required...
> >and the hex-values would be the same.
> >
> >In the Oldene Dayse one would create a PIC X field along the lines of:
> >
> >01 WS-TEST-CHAR PIC X VALUE SPACES.
> > 88 VALID-ALPHA VALUES 'A' THRU 'I',
> > 'J' THRU 'R',
> > 'S' THRU 'Z',
> > '0' THRU '9'.
> >
> >... and as testing progressed one would add '/', '+', '-', '#' and
other
> >'Look at what I found!' stuff.
> >
> >Single-character alphabetic comparisons compiled to Compare Logical
> >Immediate (CLI) and the code ran acceptably fast.
> >
> >What I am trying to find is the character-set used by ISPF
> >browse/view/edit so that I can reproduce it in an 88 or in a DFSORT
> >control-card, e.g.:
> >
> >(INCLUDE COND=(startpos,len,CH,EQ,X'B0',OR,
> > startpos,len,CH,EQ,X'nn',... etc.
> >
> >It would be greatly appreaciated were someone to post where this could
be
> >found.
>
> I agree with Pete that you aren't guaranteed that a specific code page
> is used with ISPF. However, your job in COBOL may be simpler if you
> can list all of the valid characters and character ranges in a format
> similar to your 88. Thus you code in the ENVIRONMENT DIVISION, CLASS
> IS VALID-ALPHA 'A' THRU 'I', 'J' THRU 'R', 'S' THRU 'Z', '0' THRU
> '9'.
>
> In the PROCEDURE DIVISION you would code IF field-name VALID-ALPHA to
> test for the valid characters. In the actual code you would probably
> include periods, commas, spaces and any other valid characters in the
> class. The code generated for the IF statement would probably be a
> Translate and Test instruction followed by a branch.
>
> There may be a similar capability in the sort product your shop has
> SYNCSORT or DFSORT. Look at SYNCTOOL or ICETOOL. The IBM manual is
> online and I wish the SYNCSORT manuals were.
>
> Clark Morris
> >
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN