If the spec you are working to says nothing about the inbound data other than "ASCII", you should be able to assume (yes, I know) that the data contains nothing more than the basic characters 'A' to 'Z', 'a' to 'z' and '0' to '9'. No punctuation, no characters with diacritical marks, no binary fields, etc. If this does not describe your data, your spec is incomplete.
Other than ASCII, what else do you know about the inbound data? Side note 1: I notice you always mention that your program runs as an STC. This is most likely irrelevant. Side note 2: I notice that you code in COBOL. If the fact that your program runs as an STC is relevant, I would recommend coding in HLASM in which control block management is more straightforward. Full disclosure: I don't even know how to spell BOLOC! > On Feb 18, 2018, at 12:50, scott Ford <[email protected]> wrote: > > All: > > I have a question regarding inbound ASCII data. > > We read ASCII data via a EZASOKET READ call. The data is encrypted , so we > decrypt it and then > convert to EBCDIC. I looked at FTP data and there is a SBDATACON > parameter..giving both EBCDIC and ASCII ccsids or codepages. > > My problem/issue is: > > I dont know what the inbound ASCII data stream codepage is ...after a > encrypt/Decrypt using AES128 or AES256. > I have created a temporary fix to resolve it in our STC usin a CODEPAGE= > which is the ASCII codepage. > We have been using EZACIC14/15 from the IP Socket Programmer's guide. I am > looking for a univeral way to do the > conversion, I know I can do NLS and use something like below: > > CBL DBCS,NSYMBOL(NATIONAL) > IDENTIFICATION DIVISION. > PROGRAM-ID. MAIN1. > ENVIRONMENT DIVISION. > DATA DIVISION. > WORKING-STORAGE SECTION. > 01 WS-AREA PICTURE N(50). > 01 WS-CCSID PICTURE 9(5). > 01 WS-ASCII PICTURE X(50). > 01 WS-EBCDIC PICTURE X(50). > PROCEDURE DIVISION. > MOVE "ABCDE" > TO WS-EBCDIC. > DISPLAY " WS-EBCDIC = " WS-EBCDIC. > MOVE FUNCTION NATIONAL-OF(WS-EBCDIC) > TO WS-AREA. > DISPLAY " WS-AREA = " WS-AREA. > MOVE 819 TO WS-CCSID. > MOVE FUNCTION DISPLAY-OF(WS-AREA, WS-CCSID) > TO WS-ASCII. > DISPLAY " WS-ASCII = " WS-ASCII. > DISPLAY "Now let's convert that WS-ASCII back to EBCDIC". > MOVE FUNCTION NATIONAL-OF(WS-ASCII,819 ) > TO WS-AREA. > DISPLAY " WS-AREA = " WS-AREA. > MOVE 1140 TO WS-CCSID. > MOVE FUNCTION DISPLAY-OF(WS-AREA, WS-CCSID) > TO WS-EBCDIC. > DISPLAY " WS-EBCDIC = " WS-EBCDIC. > STOP RUN. > > I "assume" i could call a C or C++ routine ans use ICONV with the input > codepage and output codepage acquired from a parameter in our STC. > > Is the parameter in the STC the best approach or am I missing something ? > > Regards, > > -- > > > > *IDMWORKS * > > Scott Ford > > z/OS Dev. > > > > > “By elevating a friend or Collegue you elevate yourself, by demeaning a > friend or collegue you demean yourself” > > > > www.idmworks.com > > [email protected] > > Blog: www.idmworks.com/blog > > > > > > *The information contained in this email message and any attachment may be > privileged, confidential, proprietary or otherwise protected from > disclosure. If the reader of this message is not the intended recipient, > you are hereby notified that any dissemination, distribution, copying or > use of this message and any attachment is strictly prohibited. If you have > received this message in error, please notify us immediately by replying to > the message and permanently delete it from your computer and destroy any > printout thereof.* > > ---------------------------------------------------------------------- > 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
