COBOL Sequential Add EBCDIC-Sequential to ASCII-Indexed |
The SimoTime Home Page |
This is an example of how a set of two COBOL programs can read an EBCDIC-Sequential file and write an ASCII-Indexed file.
In the world of programming there are many ways to solve a problem. This set of programs is provided as a COBOL example of one of the possible solutions to the problem of changing the contents and structure of data files.
We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
This program will read an EBCDIC-Sequential file and write to an ASCII-Indexed (VSAM, KSDS - Keyed Sequential Data Set) file. The keys must be in sequence (ASCII collating sequence) for the writes to the output file. It will convert both the file type (i.e. Sequential to Indexed) and the content of the records within the file. Packed-decimal and COMP fields are copied as appropriate. Character fields are converted from ASCII to EBCDIC.
The following is the content of the adm1UTCONVgenerateCOBOL.cmd command file that was used to create the COBOL source code. This process uses the UTCONVRT utility program to do the actual program generation.
@echo OFF rem * ******************************************************************* rem * admGenrONEconvert.CMD - a Windows Command File * rem * This program is provided by SimoTime Enterprises * rem * (C) Copyright 1987-2013 All Rights Reserved * rem * Web Site URL: http://www.simotime.com * rem * e-mail: helpdesk@simotime.com * rem * ******************************************************************* rem * This procedure calls the following Windows Command Files. rem * 1. Env1Base.CMD - this provides a single point for setting commonly rem * used environment variables. rem * 2. SimoNOTE.CMD - this provides a consistent process for displaying rem * messages to the screen and writing to a journal or rem * log file. rem * 3. SIMOCONV.CMD - this will do the actual compile of the rem * specified program. rem * ************************************************************************ call ..\Env1Base call USERCONV set CmdName=admGenrONEconvert rem * call SimoNOTE "***********************************************%CmdName%.CMD" call SimoNOTE "Starting JobName %CmdName%.CMD" rem * rem * Set the environment variable to use the default directives file. set AOK_Count=0 set NOK_Count=0 set SIMOGENS=PAUSE set SIMODROP=N rem set HDRD1_OVERRIDE=USER rem set HTMHDRD1=%BASELIB1%\CONVERTS\rec1hdr2.htm set GENILIBR=%BASELIB1%\CONVERTS\INCLUDES set SIMOCFG1=%BASELIB1%\CONVERTS\SIMOCFG1.cfg for /F "eol=; tokens=1,2* delims=." %%i in (SIMOTIME.LISTONE.CONVERTS.LST) do CALL SIMOCONV %%i rem * call SimoNOTE "AOKcount Compile Count for AOK is %AOK_Count% " call SimoNOTE "NOKcount Compile Count for NOK is %NOK_Count% " call SimoNOTE "Finished JobName %CmdName%.CMD " if not "%SimoGENS%" == "BATCH" pause
The following member (SQEKSA.pcf) is the process control file containing the specifications that are used by the preceding command file to generate the source code for the programs that will do the actual data file conversion.
*********************************************************************** * This Process Control File is provided by SimoTime Enterprises * * (C) Copyright 1987-2019 All Rights Reserved * * Web Site URL: http://www.simotime.com * * e-mail: helpdesk@simotime.com * *********************************************************************** * SYSUT1 is a Record Sequential, 512-byte, fixed, EBCDIC file with * Packed and Binary data. * * SYSUT2 is a KSDS, 512-byte, ASCII file with Packed and Binary * data. * * This procdedure will generate the IO Program, the callable convert * routine and the HTML Documentation for the Record Structure. *********************************************************************** * &SIMOPREP call ..\..\ENV1BASE &USERPREP call USERCONV &CONFORM IBM ©FILE CUSTCB01.cpy &HTMLFILE custcb01.htm &DIALECT C2 &VSAMload SEQUENTIAL *HEAD34 ....:....1....:....2....:....3.... &HEAD34 Conv-A2E ASC-KSDS to EBC-RSEQ &IOMODNAME SQEKSAC1 &SYSUT1 name=DX512SQE org=Sequential recfm=FIXED rlen=512 &SYSUT2 name=DX512KSA org=Indexed recfm=VARIABLE rmin=512 rmax=512 kpos=1 klen=12 &PACKEDFLD SPACECONVERT &TransCALL SQEKSAR1 &TransMODE E2A * &END
To do both the file format conversion and the record content conversion this approach will us two COBOL programs. The first program will do the file I/) that reads an EBCDIC encoded sequential file and writes to an ASCII encoded indexed file (or VSAM, KSDS). After reading a record the first program will call a second program to do the EBCDIC to ASCII conversion based on the record structure as defined in a COBOL copy file. After a return from the called program the first program will then write the ASCII encoded record to the indexed file.
The following member (SQEKSAC1.cbl) is the generated source code for the program that does the file I/O and file format conversion.
IDENTIFICATION DIVISION. PROGRAM-ID. SQEKSAC1. AUTHOR. SIMOTIME TECHNOLOGIES. ***************************************************************** * This program was generated by SimoZAPS * * A product of SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * * * Generation Date: 2018-10-10 Generation Time: 20:28:33:46 * * * * Record Record Key * * Function Name Organization Format Max-Min Pos-Len * * PRIMARY DX512SQE SEQUENTIAL FIXED 00512 * * * * SECONDARY DX512KSA INDEXED VARIABLE 00512 00001 * * 00512 00012 * * * * Translation Mode is EBCDIC to ASCII * * * ***************************************************************** ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT DX512SQE-FILE ASSIGN TO DX512SQE ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS DX512SQE-STATUS. SELECT DX512KSA-FILE ASSIGN TO DX512KSA ORGANIZATION IS INDEXED ACCESS MODE IS SEQUENTIAL RECORD KEY IS DX512KSA-PKEY-00001-00012 FILE STATUS IS DX512KSA-STATUS. ***************************************************************** DATA DIVISION. FILE SECTION. FD DX512SQE-FILE DATA RECORD IS DX512SQE-REC . 01 DX512SQE-REC. 05 DX512SQE-DATA-01 PIC X(00512). FD DX512KSA-FILE DATA RECORD IS DX512KSA-REC . 01 DX512KSA-REC. 05 DX512KSA-PKEY-00001-00012 PIC X(00012). 05 DX512KSA-DATA-00013-00500 PIC X(00500). ***************************************************************** * This program was created with the SYSMASK1.TXT file as input. * * The SYSMASK1 provides for the sequential reading of the input * * file and the sequential writing of the output file. * * * * If the output file is indexed then the input file must be in * * sequence by the field that will be used to provide the key * * for the output file. This is a sequential load process. * * * * If the key field is not in sequence then refer to SYSMASK2 * * to provide for a random add or update of the indexed file. * * * * This program mask will have the ASCII/EBCDIC table inserted * * for use by the /TRANSLATE function of SimoZAPS. * * * * For more information or questions please contact SimoTime * * Technologies. The version control number is 16.01.01 * * * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * ***************************************************************** WORKING-STORAGE SECTION. 01 SIM-TITLE. 05 T1 pic X(11) value '* SQEKSAC1 '. 05 T2 pic X(34) value 'Conv-A2E ASC-KSDS to EBC-RSEQ '. 05 T3 pic X(10) value ' v16.01.01'. 05 T4 pic X(24) value ' helpdesk@simotime.com'. 01 SIM-COPYRIGHT. 05 C1 pic X(11) value '* SQEKSAC1 '. 05 C2 pic X(32) value 'This Data File Convert Member wa'. 05 C3 pic X(32) value 's generated by SimoTime Technolo'. 05 C4 pic X(04) value 'gies'. 01 DX512SQE-STATUS. 05 DX512SQE-STATUS-L pic X. 05 DX512SQE-STATUS-R pic X. 01 DX512SQE-EOF pic X value 'N'. 01 DX512SQE-OPEN-FLAG pic X value 'C'. 01 DX512KSA-STATUS. 05 DX512KSA-STATUS-L pic X. 05 DX512KSA-STATUS-R pic X. 01 DX512KSA-EOF pic X value 'N'. 01 DX512KSA-OPEN-FLAG pic X value 'C'. 01 DX512SQE-LRECL pic 9(5) value 00512. 01 DX512KSA-LRECL pic 9(5) value 00512. 01 DX512SQE-LRECL-MAX pic 9(5) value 00512. 01 DX512KSA-LRECL-MAX pic 9(5) value 00512. ***************************************************************** * The following buffers are used to create a four-byte status * * code that may be displayed. * ***************************************************************** 01 IO-STATUS. 05 IO-STAT1 pic X. 05 IO-STAT2 pic X. 01 IO-STATUS-04. 05 IO-STATUS-0401 pic 9 value 0. 05 IO-STATUS-0403 pic 999 value 0. 01 TWO-BYTES-BINARY pic 9(4) BINARY. 01 TWO-BYTES-ALPHA redefines TWO-BYTES-BINARY. 05 TWO-BYTES-LEFT pic X. 05 TWO-BYTES-RIGHT pic X. ***************************************************************** * Message Buffer used by the Z-DISPLAY-MESSAGE-TEXT routine. * ***************************************************************** 01 MESSAGE-BUFFER. 05 MESSAGE-HEADER pic X(011) value '* SQEKSAC1 '. 05 MESSAGE-TEXT. 10 MESSAGE-TEXT-1 pic X(068) value SPACES. 10 MESSAGE-TEXT-2 pic X(188) value SPACES. 01 MSG-LSB pic 9(5) value 267. ***************************************************************** 01 PROGRAM-NAME pic X(8) value 'SQEKSAC1'. 01 INFO-STATEMENT. 05 INFO-SHORT. 10 INFO-ID pic X(8) value 'Starting'. 10 filler pic X(2) value ', '. 10 filler pic X(34) value 'Conv-A2E ASC-KSDS to EBC-RSEQ '. 05 filler pic X(24) value ' http://www.SimoTime.com'. 01 APPL-RESULT pic S9(9) comp. 88 APPL-AOK value 0. 88 APPL-EOF value 16. 01 WRITE-FLAG pic X value 'Y'. 01 DX512SQE-TOTAL. 05 DX512SQE-RDR pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(23) value 'Line count for DX512SQE'. 01 DX512KSA-TOTAL. 05 DX512KSA-ADD pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(23) value 'Line count for DX512KSA'. ***************************************************************** * The following copy file contains the translation tables for * * the ASCII and EBCDIC conversion. Also, sections of the tables * * may be used for case conversion. * ***************************************************************** COPY ASCEBCB1. ***************************************************************** PROCEDURE DIVISION. move all '*' to MESSAGE-TEXT-1 perform Z-DISPLAY-MESSAGE-TEXT move INFO-STATEMENT to MESSAGE-TEXT-1 perform Z-DISPLAY-MESSAGE-TEXT move all '*' to MESSAGE-TEXT-1 perform Z-DISPLAY-MESSAGE-TEXT perform Z-POST-COPYRIGHT perform DX512SQE-OPEN perform DX512KSA-OPEN * USRSOJ Processing not specified... perform until DX512SQE-STATUS not = '00' perform DX512SQE-READ if DX512SQE-STATUS = '00' add 1 to DX512SQE-RDR perform BUILD-OUTPUT-RECORD if WRITE-FLAG = 'Y' perform DX512KSA-WRITE if DX512KSA-STATUS = '00' add 1 to DX512KSA-ADD end-if end-if end-if end-perform * USREOJ Processing not specified... move DX512SQE-TOTAL to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move DX512KSA-TOTAL to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT if APPL-EOF move 'Complete' to INFO-ID else move 'ABENDING' to INFO-ID end-if move INFO-STATEMENT to MESSAGE-TEXT(1:79) perform Z-DISPLAY-MESSAGE-TEXT perform DX512KSA-CLOSE perform DX512SQE-CLOSE GOBACK. ***************************************************************** BUILD-OUTPUT-RECORD. * TransMODE is E2A... * TransCALL process, Record Content Conversion... move DX512SQE-REC to DX512KSA-REC call 'SQEKSAR1' using DX512KSA-REC add 00512 to ZERO giving DX512KSA-LRECL exit. ***************************************************************** * I/O Routines for the INPUT File... * ***************************************************************** DX512SQE-CLOSE. add 8 to ZERO giving APPL-RESULT. close DX512SQE-FILE if DX512SQE-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'CLOSE Failure with DX512SQE' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move DX512SQE-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* DX512SQE-READ. read DX512SQE-FILE if DX512SQE-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else if DX512SQE-STATUS = '10' add 16 to ZERO giving APPL-RESULT else add 12 to ZERO giving APPL-RESULT end-if end-if if APPL-AOK CONTINUE else if APPL-EOF move 'Y' to DX512SQE-EOF else move 'READ Failure with DX512SQE' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move DX512SQE-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if end-if exit. *---------------------------------------------------------------* DX512SQE-OPEN. add 8 to ZERO giving APPL-RESULT. open input DX512SQE-FILE if DX512SQE-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to DX512SQE-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with DX512SQE' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move DX512SQE-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. ***************************************************************** * I/O Routines for the OUTPUT File... * ***************************************************************** DX512KSA-WRITE. if DX512KSA-OPEN-FLAG = 'C' perform DX512KSA-OPEN end-if write DX512KSA-REC if DX512KSA-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else if DX512KSA-STATUS = '10' add 16 to ZERO giving APPL-RESULT else add 12 to ZERO giving APPL-RESULT end-if end-if. if APPL-AOK CONTINUE else move 'WRITE Failure with DX512KSA' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move DX512KSA-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* DX512KSA-OPEN. add 8 to ZERO giving APPL-RESULT. open OUTPUT DX512KSA-FILE if DX512KSA-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to DX512KSA-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with DX512KSA' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move DX512KSA-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* DX512KSA-CLOSE. add 8 to ZERO giving APPL-RESULT. close DX512KSA-FILE if DX512KSA-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'C' to DX512KSA-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'CLOSE Failure with DX512KSA' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move DX512KSA-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. ***************************************************************** * The following Z-ROUTINES provide administrative functions * * for this program. * ***************************************************************** * ABEND the program, post a message to the console and issue * * a STOP RUN. * ***************************************************************** Z-ABEND-PROGRAM. if MESSAGE-TEXT not = SPACES perform Z-DISPLAY-MESSAGE-TEXT end-if move 'PROGRAM-IS-ABENDING...' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT add 12 to ZERO giving RETURN-CODE STOP RUN. * exit. ***************************************************************** Z-CALCULATE-MESSAGE-LSB. add 267 to ZERO giving MSG-LSB perform until MSG-LSB < 80 or MESSAGE-BUFFER(MSG-LSB:1) not = SPACE if MESSAGE-BUFFER(MSG-LSB:1) = SPACE subtract 1 from MSG-LSB end-if end-perform exit. ***************************************************************** * Display CONSOLE messages... * ***************************************************************** Z-DISPLAY-MESSAGE-TEXT. perform Z-CALCULATE-MESSAGE-LSB display MESSAGE-BUFFER(1:MSG-LSB) move all SPACES to MESSAGE-TEXT exit. ***************************************************************** * Display the file status bytes. This routine will display as * * four digits. If the full two byte file status is numeric it * * will display as 00nn. If the 1st byte is a numeric nine (9) * * the second byte will be treated as a binary number and will * * display as 9nnn. * ***************************************************************** Z-DISPLAY-IO-STATUS. if IO-STATUS not NUMERIC or IO-STAT1 = '9' move IO-STAT1 to IO-STATUS-04(1:1) subtract TWO-BYTES-BINARY from TWO-BYTES-BINARY move IO-STAT2 to TWO-BYTES-RIGHT add TWO-BYTES-BINARY to ZERO giving IO-STATUS-0403 move 'File Status is: nnnn' to MESSAGE-TEXT move IO-STATUS-04 to MESSAGE-TEXT(17:4) perform Z-DISPLAY-MESSAGE-TEXT else move '0000' to IO-STATUS-04 move IO-STATUS to IO-STATUS-04(3:2) move 'File Status is: nnnn' to MESSAGE-TEXT move IO-STATUS-04 to MESSAGE-TEXT(17:4) perform Z-DISPLAY-MESSAGE-TEXT end-if exit. ***************************************************************** Z-POST-COPYRIGHT. display SIM-TITLE display SIM-COPYRIGHT exit. ***************************************************************** * This program was generated by SimoZAPS * * A product of SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * * * Generation Date: 2018-10-10 Generation Time: 20:28:33:48 * *****************************************************************
The following member (SQEKSAR1.cbl) is the generated source code for the program the called program that does the record content conversion between EBCDIC and ASCII based on the record structure that is defined by a COBOL copy file..
IDENTIFICATION DIVISION. PROGRAM-ID. SQEKSAR1. AUTHOR. SIMOTIME TECHNOLOGIES. ***************************************************************** * This routine was generated by SimoREC1 * * A product of SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * Generation Date: 2018/10/10 Generation Time: 20:28:33:52 * ***************************************************************** DATA DIVISION. WORKING-STORAGE SECTION. 01 IX-1 PIC 9(5) VALUE 0. 01 RM-1 PIC 9(5) VALUE 0. 01 RO-1 PIC 9(5) VALUE 0. 01 IX-2 PIC 9(5) VALUE 0. 01 RM-2 PIC 9(5) VALUE 0. 01 RO-2 PIC 9(5) VALUE 0. COPY AE0437B1. COPY ASCEBCB2. ***************************************************************** LINKAGE SECTION. COPY CUSTCB01. ***************************************************************** PROCEDURE DIVISION using CUST-RECORD. inspect CUST-NUMBER converting E-INFO to A-INFO inspect CUST-STATUS converting E-INFO to A-INFO inspect CUST-LAST-NAME converting E-INFO to A-INFO inspect CUST-FIRST-NAME converting E-INFO to A-INFO inspect CUST-MID-NAME converting E-INFO to A-INFO inspect CUST-ADDRESS-1 converting E-INFO to A-INFO inspect CUST-ADDRESS-2 converting E-INFO to A-INFO inspect CUST-CITY converting E-INFO to A-INFO inspect CUST-STATE converting E-INFO to A-INFO inspect CUST-POSTAL-CODE converting E-INFO to A-INFO inspect CUST-PHONE-HOME converting E-INFO to A-INFO inspect CUST-PHONE-WORK converting E-INFO to A-INFO inspect CUST-PHONE-CELL converting E-INFO to A-INFO * Packed............... CUST-CREDIT-LIMIT * Group10 CUST-DISCOUNT occurs 00003 times * Table Element........ CUST-DISCOUNT-CODE 000001 * Binary............... CUST-DISCOUNT-CODE * Table Element........ CUST-DISCOUNT-RATE 000001 inspect CUST-RECORD(0000306:0000005) converting E-NUMB to A-NUMB * Table Element........ CUST-DISCOUNT-DATE 000001 inspect CUST-DISCOUNT-DATE(1) converting E-INFO to A-INFO * Table Element........ CUST-DISCOUNT-CODE 000002 * Binary............... CUST-DISCOUNT-CODE * Table Element........ CUST-DISCOUNT-RATE 000002 inspect CUST-RECORD(0000321:0000005) converting E-NUMB to A-NUMB * Table Element........ CUST-DISCOUNT-DATE 000002 inspect CUST-DISCOUNT-DATE(2) converting E-INFO to A-INFO * Table Element........ CUST-DISCOUNT-CODE 000003 * Binary............... CUST-DISCOUNT-CODE * Table Element........ CUST-DISCOUNT-RATE 000003 inspect CUST-RECORD(0000336:0000005) converting E-NUMB to A-NUMB * Table Element........ CUST-DISCOUNT-DATE 000003 inspect CUST-DISCOUNT-DATE(3) converting E-INFO to A-INFO inspect CUST-LADATE converting E-INFO to A-INFO inspect CUST-LATIME converting E-INFO to A-INFO * Zoned-Decimal-Nosign. CUST-TOKEN inspect CUST-RECORD(365:3) converting E-NUMB to A-NUMB * Filler............... A Non-Unique Reference to a Data Item inspect CUST-RECORD(368:145) converting E-INFO to A-INFO GOBACK. ***************************************************************** * This routine was generated by SimoREC1 * * A product of SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * Generation Date: 2018/10/10 Generation Time: 20:28:33:52 * *****************************************************************
The following member (ASCEBCB1.cpy) show the content of the COBOL copy file that contains the tables that are used to do the EBCDIC to ASCII conversion.
***************************************************************** * AE9437B1.cpy - a COBOL Copy File * * Copyright (C) 1987-2018 SimoTime Technologies * * All Rights Reserved * * Provided by SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * ***************************************************************** * The following tables are used by the INSPECT statement to do * * the conversion between EBCDIC and ASCII. * * * * inspect FIELD-NAME converting EBCDIC-INFO to ASCII-INFO * * inspect FIELD-NAME converting ASCII-INFO to EBCDIC-INFO * * * * The tables include the alphabet for upper and lower case, the * * digits 0-9, the special characters (US) and the alternate * * codes for A, E, I, O, and U with the appropriate acute, * * grave, umlaut, circumflex and tilde. * * To display the alternate codes the Courier New (Fixed) or * * Times New Roman (Proportional) font should be used. * * * * SimoZAPS contains four tables that may be used for various * * Upper/Lower Case or EBCDIC/ASCII conversion requirements. * * ASCEBCB1.CPY - includes a full character set for the alphabet * * (upper/lower case), digit, special characters * * and alternate codes for characters with the * * acute, grave, umlaut, tilde and circumflex. * * Caution: this table does not convert the Y * * characters with an umlat. * * ASCEBCB2.CPY - includes the character set for the translation * * between EBCDIC/ASCII of signed/unsigned, * * zoned-decimal, numeric fields. * * ASCEBCB3.CPY - includes the character set for the alternate * * codes with the acute, grave, umlaut, tilde and * * circumflex. This is primarily used for case * * conversion. * * Note: this table converts the Y characters * * with an umlat, this will convert high-values * * X'FF' to X'DF' * * ASCEBCB4.CPY - includes the character set for the alphabet * * (upper/lower case), digit, special characters. * * This is primarily used in the US where the * * alternate codes may not be required. * * ASCEBCB5.CPY - includes a full character set for the alphabet * * (upper/lower case), digit, special characters * * and alternate codes for characters with the * * acute, grave, umlaut, tilde and circumflex. * * Caution: this table will convert the Y * * characters with an umlat. * ***************************************************************** * * ------------------------------------------------------------ 01 EBCDIC-DATA. 05 FILLER pic X(16) value X'000102030405060708090A0B0C0D0E0F'. 000-015 05 FILLER pic X(16) value X'101112131415161718191A1B1C1D1E1F'. 016-031 05 FILLER pic X(16) value X'202122232425262728292A2B2C2D2E2F'. 032-047 05 FILLER pic X(16) value X'303132333435363738393A3B3C3D3E3F'. 048-063 05 FILLER pic X(16) value X'404142434445464748494A4B4C4D4E4F'. 064-079 05 FILLER pic X(16) value X'505152535455565758595A5B5C5D5E5F'. 080=095 05 FILLER pic X(16) value X'606162636465666768696A6B6C6D6E6F'. 096-111 05 FILLER pic X(16) value X'707172737475767778797A7B7C7D7E7F'. 112-127 05 FILLER pic X(16) value X'808182838485868788898A8B8C8D8E8F'. 128-143 05 FILLER pic X(16) value X'909192939495969798999A9B9C9D9E9F'. 144-159 05 FILLER pic X(16) value X'A0A1A2A3A4A5A6A7A8A9AAABACADAEAF'. 160-175 05 FILLER pic X(16) value X'B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF'. 176-191 05 FILLER pic X(16) value X'C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF'. 192-207 05 FILLER pic X(16) value X'D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF'. 208-223 05 FILLER pic X(16) value X'E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF'. 224-239 05 FILLER pic X(16) value X'F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF'. 240-255 01 E-INFO redefines EBCDIC-DATA pic X(256). 01 EBCDIC-TABLE redefines EBCDIC-DATA. 05 EBCDIC-BYTE pic X occurs 256 times. * * ------------------------------------------------------------ 01 ASCII-DATA. 05 FILLER pic X(16) value X'000102039C09867F978D8E0B0C0D0E0F'. 000-015 05 FILLER pic X(16) value X'101112139D8508871819928F1C1D1E1F'. 016-031 05 FILLER pic X(16) value X'80818283840A171B88898A8B8C050607'. 032-047 05 FILLER pic X(16) value X'909116939495960498999A9B14159E1A'. 048-063 05 FILLER pic X(16) value X'20A0E2E4E0E1E3E5E7F1A22E3C282B7C'. 064-079 05 FILLER pic X(16) value X'26E9EAEBE8EDEEEFECDF21242A293BAC'. 080=095 05 FILLER pic X(16) value X'2D2FC2C4C0C1C3C5C7D1A62C255F3E3F'. 096-111 05 FILLER pic X(16) value X'F8C9CACBC8CDCECFCC603A2340273D22'. 112-127 05 FILLER pic X(16) value X'D8616263646566676869ABBBF0FDFEB1'. 128-143 05 FILLER pic X(16) value X'B06A6B6C6D6E6F707172AABAE6B8C6A4'. 144-159 05 FILLER pic X(16) value X'B57E737475767778797AA1BFD0DDDEAE'. 160-175 05 FILLER pic X(16) value X'5EA3A5B7A9A7B6BCBDBE5B5DAFA8B4D7'. 176-191 05 FILLER pic X(16) value X'7B414243444546474849ADF4F6F2F3F5'. 192-207 05 FILLER pic X(16) value X'7D4A4B4C4D4E4F505152B9FBFCF9FAFF'. 208-223 05 FILLER pic X(16) value X'5CF7535455565758595AB2D4D6D2D3D5'. 224-239 05 FILLER pic X(16) value X'30313233343536373839B3DBDCD9DAFF'. 240-255 01 A-INFO redefines ASCII-DATA pic X(256). 01 ASCII-TABLE redefines ASCII-DATA. 05 ASCII-BYTE pic X occurs 256 times. * *** AE0437B1 - End-of-Copy File - - - - - - - - - - - AE0437B1 * ***************************************************************** *
This is an example of how a set of two COBOL programs can read an EBCDIC-Sequential file and write an ASCII-Indexed file. This document may be used as a tutorial for new programmers or as a quick reference for experienced programmers.
In the world of programming there are many ways to solve a problem. This documentation and software were developed and tested on systems that are configured for a SIMOTIME environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.
SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SIMOTIME Services or Technologies please contact us using the information in the Contact or Feedback section of this document.
Software Agreement and Disclaimer
Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Technologies. Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Technologies.
SimoTime Technologies makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Technologies shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material.
This section includes links to documents with additional information that are beyond the scope and purpose of this document. The first group of documents may be available from a local system or via an internet connection, the second group of documents will require an internet connection.
Note: A SimoTime License is required for the items to be made available on a local system or server.
The following links may be to the current server or to the Internet.
Explore the Principles of Data File Conversion. This link includes guidelines for defining requirements and determining the scope of effort for a data conversion effort.
Explore How to Generate a Data File Convert Program using simple specification statements in a Process Control File (PCF). This link to the User Guide includes the information necessary to create a Process Control File and generate the COBOL programs that will do the actual data file conversion. The User Guide contains a list of the PCF statements that are used for the data file convert process.
Explore The ASCII and EBCDIC Translation Tables. These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats.
Explore The File Status Return Codes that are used to interpret the results of accessing VSAM data sets and/or QSAM files.
The following links will require an internet connect.
A good place to start is The SimoTime Home Page for access to white papers, program examples and product information. This link requires an Internet Connection
Explore The Micro Focus Web Site for more information about products (including Micro Focus COBOL) and services available from Micro Focus. This link requires an Internet Connection.
Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.
This document was created and is maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.
1. | Send an e-mail to our helpdesk. |
1.1. | helpdesk@simotime.com. |
2. | Our telephone numbers are as follows. |
2.1. | 1 415 763-9430 office-helpdesk |
2.2. | 1 415 827-7045 mobile |
We appreciate hearing from you.
SimoTime Technologies was founded in 1987 and is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems.
Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms.
Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform. The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process. SimoTime has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment.
Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com
Return-to-Top |
COBOL Source Code for EBCDIC, Sequential to ASCII, Indexed (Sequential-Add) Conversion |
Copyright © 1987-2025 SimoTime Technologies and Services All Rights Reserved |
When technology complements business |
http://www.simotime.com |