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
