CBLVLRC3, File Convert ZOS/V to Micro Focus v4-32760 |
The SimoTime Home Page |
This document includes the COBOL source code for the program that converts a Mainframe (or ZOS) formatted sequential file with variable length records with the size varying from 4 to 32,760 bytes to a Micro Focus Sequential file with variable length records.
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
The following source code (CBLVLRC3.cbl) is the COBOL program that does file format conversion
IDENTIFICATION DIVISION. PROGRAM-ID. CBLVLRC3. 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: 2012-05-17 Generation Time: 04:26:57:75 * * * * Record Record Key * * Function Name Organization Format Max-Min Pos-Len * * INPUT BSIODSN1 ZOS/V VARIABLE 32760 * * 00004 * * OUTPUT ALPHAV01 SEQUENTIAL VARIABLE 32760 * * 00004 * * * ***************************************************************** ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT ALPHAV01-FILE ASSIGN TO ALPHAV01 ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS ALPHAV01-STATUS. ***************************************************************** DATA DIVISION. FILE SECTION. FD ALPHAV01-FILE DATA RECORD IS ALPHAV01-REC RECORDING MODE IS V RECORD VARYING FROM 00004 TO 32760 DEPENDING ON ALPHAV01-LRECL . 01 ALPHAV01-REC. 05 ALPHAV01-DATA-01 PIC X(32760). ***************************************************************** * This program was created with the SYSZGET1.TXT file as input. * * The SYSZGET1 provides for the BSIO processing of the input * * file and the sequential writing of the output file. * * * * For additional information contact SimoTime Technologies. * * * * 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 '* CBLVLRC3 '. 05 T2 pic X(34) value 'Convert ZOS/V to RSEQ/v4-32760 '. 05 T3 pic X(10) value ' v12.05.14'. 05 T4 pic X(24) value ' helpdesk@simotime.com'. 01 SIM-COPYRIGHT. 05 C1 pic X(11) value '* CBLVLRC3 '. 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 SIM-THANKS-01. 05 C1 pic X(11) value '* CBLVLRC3 '. 05 C2 pic X(32) value 'Thank you for using this program'. 05 C3 pic X(32) value ' provided from SimoTime Technolo'. 05 C4 pic X(04) value 'gies'. 01 SIM-THANKS-02. 05 C1 pic X(11) value '* CBLVLRC3 '. 05 C2 pic X(32) value 'Please send all inquires or sugg'. 05 C3 pic X(32) value 'estions to the helpdesk@simotime'. 05 C4 pic X(04) value '.com'. 01 BSIODSN1-STATUS. 05 BSIODSN1-STATUS-L pic X. 05 BSIODSN1-STATUS-R pic X. 01 BSIODSN1-EOF pic X value 'N'. 01 BSIODSN1-OPEN-FLAG pic X value 'C'. 01 ALPHAV01-STATUS. 05 ALPHAV01-STATUS-L pic X. 05 ALPHAV01-STATUS-R pic X. 01 ALPHAV01-EOF pic X value 'N'. 01 ALPHAV01-OPEN-FLAG pic X value 'C'. 01 BSIODSN1-LRECL pic 9(5) value 32760. 01 ALPHAV01-LRECL-ALPHA. 05 ALPHAV01-LRECL pic 9(5) value 32760. 01 BSIODSN1-LRECL-MAX pic 9(5) value 32760. ***************************************************************** * 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(11) value '* CBLVLRC3 '. 05 MESSAGE-TEXT. 10 MESSAGE-TEXT-1 pic X(68) value SPACES. 10 MESSAGE-TEXT-2 pic X(188) value SPACES. ***************************************************************** 01 PROGRAM-NAME pic X(8) value 'CBLVLRC3'. 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 'Convert ZOS/V to RSEQ/v4-32760 '. 05 filler pic X(24) value ' http://www.SimoTime.com'. ***************************************************************** * Data-structure for environment variable get routine... * ***************************************************************** 01 ENV-VAR-NAME pic X(16) value SPACES. 01 ENV-VAR-VALUE pic X(256) value SPACES. 01 APPL-RESULT pic S9(9) comp. 88 APPL-AOK value 0. 88 APPL-EOF value 16. 01 RECORD-LENGTH-DISPLAY. 05 filler pic X(15) value 'Record length: '. 05 RECORD-LENGTH-VALUE pic 9(5) value 0. 01 RECORD-MIN-DISPLAY. 05 filler pic X(15) value 'Record MIN is: '. 05 RECORD-MIN-VALUE pic 9(4) value 0. 01 RECORD-MAX-DISPLAY. 05 filler pic X(15) value 'Record MAX is: '. 05 RECORD-MAX-VALUE pic 9(4) value 0. 01 BSIOREAD-TOTAL. 05 filler pic X(18) value 'BSIOREAD count is '. 05 BSIOREAD-COUNT pic 9(7) value 0. 01 BSIOBLOK-TOTAL. 05 filler pic X(18) value 'BSIOBLOK count is '. 05 BSIOBLOK-COUNT pic 9(7) value 0. 01 BSIODSN1-TOTAL. 05 BSIODSN1-RDR pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(23) value 'Line count for BSIODSN1'. 01 ALPHAV01-TOTAL. 05 ALPHAV01-ADD pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(23) value 'Line count for ALPHAV01'. COPY PASSVREC. ***************************************************************** PROCEDURE DIVISION. perform GET-STARTED perform ALPHAV01-OPEN add 80 to ZERO giving ALPHAV01-LRECL perform until VREC-RESPOND not = ZERO call 'SIMOZGET' using PASSVREC-AREA if VREC-RESPOND = ZERO add VREC-LENGTH to ZERO giving ALPHAV01-LRECL move VREC-BUFFER to ALPHAV01-REC perform ALPHAV01-WRITE end-if end-perform perform ALPHAV01-CLOSE perform Z-THANK-YOU. GOBACK. ***************************************************************** GET-STARTED. perform Z-POST-COPYRIGHT move 'GET ' to VREC-REQUEST move ZERO to VREC-RESPOND move ZERO to VREC-LENGTH move SPACES to VREC-BUFFER exit. ***************************************************************** * I/O Routines for the OUTPUT File... * ***************************************************************** ALPHAV01-WRITE. if ALPHAV01-OPEN-FLAG = 'C' perform ALPHAV01-OPEN end-if write ALPHAV01-REC if ALPHAV01-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else if ALPHAV01-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 ALPHAV01' to MESSAGE-TEXT perform Z-DISPLAY-CONSOLE-MESSAGE move ALPHAV01-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* ALPHAV01-OPEN. add 8 to ZERO giving APPL-RESULT. open OUTPUT ALPHAV01-FILE if ALPHAV01-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to ALPHAV01-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with ALPHAV01' to MESSAGE-TEXT perform Z-DISPLAY-CONSOLE-MESSAGE move ALPHAV01-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* ALPHAV01-CLOSE. add 8 to ZERO giving APPL-RESULT. close ALPHAV01-FILE if ALPHAV01-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'C' to ALPHAV01-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'CLOSE Failure with ALPHAV01' to MESSAGE-TEXT perform Z-DISPLAY-CONSOLE-MESSAGE move ALPHAV01-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. ***************************************************************** * The following Z-Routines perform administrative tasks * * 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-CONSOLE-MESSAGE end-if move 'PROGRAM-IS-ABENDING...' to MESSAGE-TEXT perform Z-DISPLAY-CONSOLE-MESSAGE add 12 to ZERO giving RETURN-CODE STOP RUN. * exit. ***************************************************************** * Display CONSOLE messages... * ***************************************************************** Z-DISPLAY-CONSOLE-MESSAGE. if MESSAGE-TEXT-2 = SPACES display MESSAGE-BUFFER(1:79) else display MESSAGE-BUFFER end-if move all SPACES to MESSAGE-TEXT exit. ***************************************************************** * Display the file status bytes. This routine will display as * * two digits if the full two byte file status is numeric. If * * second byte is non-numeric then it will be treated as a * * binary number. * ***************************************************************** Z-DISPLAY-IO-STATUS. if IO-STATUS not NUMERIC or IO-STAT1 = '9' subtract TWO-BYTES-BINARY from TWO-BYTES-BINARY move IO-STAT2 to TWO-BYTES-RIGHT display '* VRECEXC1 File-Status-' IO-STAT1 '/' TWO-BYTES-BINARY else display '* VRECEXC1 File-Status-' IO-STATUS end-if exit. ***************************************************************** Z-POST-COPYRIGHT. display SIM-TITLE display SIM-COPYRIGHT exit. ***************************************************************** Z-THANK-YOU. display SIM-THANKS-01 display SIM-THANKS-02 exit. ***************************************************************** * This example is provided by SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * ***************************************************************** ***************************************************************** * 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: 2012-05-17 Generation Time: 04:26:57:77 * *****************************************************************
The following are the COBOL copy files used by the program.
The following (ASCEBCB1.cpy) is the source code for the copy file that defines an ASCII table and an EBCDIC table that are used for data conversion(between ASCII and EBCIDC) and case conversion (between upper and lower case).
***************************************************************** * 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 * ***************************************************************** *
The following (PASSBSIO.cpy) is the source code for the copy file that defines the data structure of the pass area used to call SIMOBSIO.
***************************************************************** * PASSBSIO is a COBOL Copy File * * Data Structure or Pass Area used for calling SIMOBSIO. * * Copyright (C) 1987-2019 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 * ***************************************************************** * 01 PSIO-PASS-AREA. 05 PSIO-REQUEST pic X(8). 05 PSIO-RETURN pic 9(4). 05 PSIO-FILENAME pic X(256). 05 PSIO-FILE-SIZE pic 9(12). 05 PSIO-OFFSET pic 9(12). 05 PSIO-LENGTH pic 9(7). 05 PSIO-MAX-SIZE pic 9(7). 05 PSIO-BUFFER pic X(32760). * *** PASSBSIO - End-of-Copy File - - - - - - - - - - - PASSBSIO * ***************************************************************** *
This document includes the COBOL source code for the program that converts a Mainframe (or ZOS) formatted sequential file with variable length records with the size varying from 4 to 32,760 bytes to a Micro Focus Sequential file with variable length records. This document may be used to assist 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 How to FTP (using BINARY mode) a File with Variable Length Records from a Mainframe System to a Windows System and then convert the Mainframe format to a Micro Focus format. The mainline program will call the SIMOVREC and SIMOBSIO modules that are available from SimoTime in a separate package.
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.
Explore the File Formats and various Numeric Formats being used in a multi-system complex consisting of Mainframe (z/OS), Linux, UNIX or Windows systems.
The following links will require an internet connect.
This suite of programs and documentation is available for download. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.
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.
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 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 program for File Format Conversion |
Copyright © 1987-2025 SimoTime Technologies and Services All Rights Reserved |
When technology complements business |
http://www.simotime.com |