Data Extract
When technology complements business   Customer Master File
Copyright © 1987-2007  SimoTime Enterprises, LLC  All Rights Reserved http://www.simotime.com

 
Introduction Version 06.11.01
  Possibilites and Considerations 
  JCL Member for a Mainframe-Oriented Environment
  The COBOL I/O Program
  The COBOL Conversion Routine
  Summary
 
  Software Agreement and Disclaimer
  Downloads and Links to Similar Pages
  Glossary of Terms
  Comments or Suggestions
  About SimoTime

Introduction
(Next) (Previous) (Table-of-Contents)

This suite of sample programs describes how to extract data from the Customer Master File. The numeric fields will be expanded (Packed or Binary) and the trailing spaces within the text fields will be truncated. A new record will be constructed with the fields being concatenated and separated by a comma. The newly constructed record will be written to a sequential file. The file may now be transferred from the mainframe to a Windows system using the FIle Transfer Protocol (FTP) and easily imported into a Microsoft Excel spreadsheet.

The extract of data by fields within the record and the reformatting of the output records is actually accomplished with two COBOL programs. The first program does the File I/O of reading the Customer Master File and writing reformatted records to a sequential file. The File I/O program calls the second program to do the record formatting that expands the numeric fields and does blank truncation on the text fields and then places a comma between the fields as the field delimiter. The COBOL programs were generated using SimoTime technology.

Possibilities and Considerations
(Next) (Previous) (Table-of-Contents)

When running this job on a Mainframe System the output file will be an EBCDIC-encoded, record-sequential file. The records will be concatenated fields of text strings separated (or delimited) by a comma. This file may be downloaded from the mainframe to a Windows system using FTP in ASCII mode. Since the output file is all text it will be properly converted from EBCDIC to ASCII during the file transfer (FTP) process. It will also be converted from a Record-Sequential file to a Line-Sequential file (Micro Focus terminology for ASCII/Text File). The file is now ready to import into Excel.

When running the job on a Windows System with Micro Focus and using EBCDIC encoding the output file will be an EBCDIC-encoded, record-sequential file. The records will be concatenated fields of text strings separated (or delimited) by a comma. Since we no longer use the FTP process to transfer the file we no longer have the benefit of the FTP process doing the file-format and file-content conversion. Therefore, we need an alternative method for doing the file format conversion from record-sequential to line-sequential and the file content conversion from EBCDIC to ASCII. Refer to the  File-Format and File-Content Conversion Program  for more information.

When running the job on a Windows System with Micro Focus and using ASCII encoding the output file will be an ASCII-encoded, record-sequential file. The records will be concatenated fields of text strings separated (or delimited) by a comma. Since we no longer use the FTP process to transfer the file and we no longer have the benefit of the FTP process doing the file-format conversion (since we are running in an ASCII-encoded configuration the file-content conversion is not a requirement). Therefore, we need an alternative method for doing the file format conversion from record-sequential to line-sequential. Refer to the  File-Format Conversion Program  for more information.

Note: This document provides a brief oveview of the  Micro Focus File Formats  available on a Windows or UNIX System.

JCL Member for a Mainframe-Oriented Environment
(Next) (Previous) (Table-of-Contents)

The term Mainframe-Oriented refers to an actual IBM Mainframe, Micro Focus Mainframe Express or Micro Focus Enterprise Server with the Mainframe Transaction Option and the Batch Facility. The following (CUEXTJ01.JCL) is a listing of the JCL member needed to run this job.

//CUEXTJ01 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*                   This program is provided by:                    *
//*                    SimoTime Enterprises, LLC                      *
//*           (C) Copyright 1987-2005 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Read Customer Master File, write to a sequential file
//* Author - SimoTime Enterprises
//* Date   - January 01, 1989
//*
//* This set of programs will run on a mainframe under MVS or on
//* a Personal Computer running Windows and Mainframe Express by
//* Micro Focus.
//*
//*   ************                    ************
//*   *  Entry   *                    *  Entry   *
//*   *   MVS    *                    * Windows  *
//*   ************                    ************
//*        *                               *
//*   ************                    ************
//*   * CUEXTJ01 *                    * CUEXTJ01 *
//*   ********jcl*                    ********cmd*
//*        *                               *
//*   ************                         *
//*   * IEFBR14  *                         *
//*   ********utl*                         *
//*        *                               *
//*        *********************************
//*                        *
//*                        *
//*   ************    ************    ************
//*   * CUSTMAST *----* CUSEXTC1 *----* CUSEXTSV *
//*   ************    ********cbl*    ********dat*
//*                        *   *
//*                        *   *
//*                        *   *---CALL----*
//*                        *               *
//*                        *               *
//*                        *          ************
//*                        *          * CUSEXTR1 *
//*                        *          ********cbl*
//*                        *
//*                   ************
//*                   *   EOJ    *
//*                   ************
//*
//* *******************************************************************
//* Step   1 of 2  This job step will delete a previously created file.
//*
//DELTSEQ1 EXEC PGM=IEFBR14
//CUSEXTSV DD  DSN=SIMOTIME.DATA.CUSEXTSV,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=256,DSORG=PS)
//* *******************************************************************
//* Step   2 of 2  Execute the Sample programs....
//*
//CBLEXTS1 EXEC PGM=CUSEXTC1
//STEPLIB  DD  DSN=MFI01.SIMOPROD.LOADLIB1,DISP=SHR
//CUSTMAST DD  DSN=SIMOTIME.DATA.CUSTMAST,DISP=SHR
//CUSEXTSV DD  DSN=SIMOTIME.DATA.CUSEXTSV,DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=256,DSORG=PS)
//*

The COBOL I/O Program
(Next) (Previous) (Table-of-Contents)

The following (CUSEXTC1.CBL) is the COBOL I/O program that was generated with SimoTime technology. The program was tested using Micro Focus Enterprise Server on Windows/XP. The program was successfully executed in both an EBCDIC and ASCII encoded configuration.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CUSEXTC1.
       AUTHOR.        SIMOTIME ENTERPRISES.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Enterprises                 *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2007-02-19  Generation Time: 22:38:47:56    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  INPUT     CUSTMAST INDEXED       VARIABLE   00512    00001   *
      *                                                       00012   *
      *  OUTPUT    CUSEXTSV SEQUENTIAL    VARIABLE   00256            *
      *                                                               *
      *                                                               *
      *                Translation Mode is UNKNOWN                    *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT CUSTMAST-FILE  ASSIGN TO       CUSTMAST
                  ORGANIZATION  IS INDEXED
                  ACCESS MODE   IS SEQUENTIAL
                  RECORD KEY    IS CUSTMAST-KEY-01
                  FILE STATUS   IS CUSTMAST-STATUS.
           SELECT CUSEXTSV-FILE  ASSIGN TO       CUSEXTSV
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS CUSEXTSV-STATUS.

      *****************************************************************
       DATA DIVISION.
       FILE SECTION.
       FD  CUSTMAST-FILE
           DATA RECORD    IS CUSTMAST-REC
           .
       01  CUSTMAST-REC.
           05  CUSTMAST-KEY-01  PIC X(00012).
           05  CUSTMAST-DATA-01 PIC X(00500).

       FD  CUSEXTSV-FILE
           DATA RECORD    IS CUSEXTSV-REC
           .
       01  CUSEXTSV-REC.
           05  CUSEXTSV-DATA-01 PIC X(00256).

      *****************************************************************
      * This program was created using 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.                                          *
      *                                                               *
      * 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 additional information contact SimoTime Enterprises.      *
      *                                                               *
      *        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 '* CUSEXTC1 '.
           05  T2 pic X(34) value 'Data Migration and Conversion     '.
           05  T3 pic X(10) value 'v06.01.01 '.
           05  T4 pic X(24) value ' http://www.simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CUSEXTC1 '.
           05  C2 pic X(20) value 'Created by SimoZAPS,'.
           05  C3 pic X(20) value '  a utility package '.
           05  C4 pic X(28) value 'of SimoTime Enterprises, LLC'.

       01  CUSTMAST-STATUS.
           05  CUSTMAST-STATUS-L     pic X.
           05  CUSTMAST-STATUS-R     pic X.
       01  CUSTMAST-EOF              pic X       value 'N'.
       01  CUSTMAST-OPEN-FLAG        pic X       value 'C'.

       01  CUSEXTSV-STATUS.
           05  CUSEXTSV-STATUS-L     pic X.
           05  CUSEXTSV-STATUS-R     pic X.
       01  CUSEXTSV-EOF              pic X       value 'N'.
       01  CUSEXTSV-OPEN-FLAG        pic X       value 'C'.

       01  CUSTMAST-LRECL    pic 9(5)    value 00512.
       01  CUSEXTSV-LRECL    pic 9(5)    value 00256.

      *****************************************************************
      * 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 '* CUSEXTC1 '.
           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 'CUSEXTC1'.

       01  APPL-RESULT             pic S9(9)    comp.
           88  APPL-AOK            value 0.
           88  APPL-EOF            value 16.

       01  CUSTMAST-TOTAL.
           05  CUSTMAST-RDR  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for CUSTMAST'.
       01  CUSEXTSV-TOTAL.
           05  CUSEXTSV-ADD  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for CUSEXTSV'.


      *****************************************************************
       PROCEDURE DIVISION.
           perform Z-POST-COPYRIGHT
           perform CUSTMAST-OPEN
           perform CUSEXTSV-OPEN

           perform until CUSTMAST-STATUS not = '00'
               perform CUSTMAST-READ
               if  CUSTMAST-STATUS = '00'
                   add 1 to CUSTMAST-RDR
                   perform BUILD-OUTPUT-RECORD
                   perform CUSEXTSV-WRITE
                   if  CUSEXTSV-STATUS = '00'
                       add 1 to CUSEXTSV-ADD
                   end-if
               end-if
           end-perform

           move CUSTMAST-TOTAL to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT

           move CUSEXTSV-TOTAL to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT

           if  APPL-EOF
               move 'is Complete...' to MESSAGE-TEXT
           else
               move 'is ABENDING...' to MESSAGE-TEXT
           end-if
           perform Z-DISPLAY-MESSAGE-TEXT

           perform CUSEXTSV-CLOSE
           perform CUSTMAST-CLOSE
           GOBACK.

      *****************************************************************
       BUILD-OUTPUT-RECORD.
      *>   Extract CALL process...
           call 'CUSEXTR1'                        using CUSEXTSV-REC
                                                        CUSTMAST-REC
           add 00256 to ZERO giving CUSEXTSV-LRECL
           exit.

      *****************************************************************
      * I/O Routines for the INPUT File...                            *
      *****************************************************************
       CUSTMAST-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close CUSTMAST-FILE
           if  CUSTMAST-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 CUSTMAST' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move CUSTMAST-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       CUSTMAST-READ.
           read CUSTMAST-FILE
           if  CUSTMAST-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  CUSTMAST-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 CUSTMAST-EOF
               else
                   move 'READ Failure with CUSTMAST' to MESSAGE-TEXT
                   perform Z-DISPLAY-MESSAGE-TEXT
                   move CUSTMAST-STATUS to IO-STATUS
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       CUSTMAST-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open input CUSTMAST-FILE
           if  CUSTMAST-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to CUSTMAST-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with CUSTMAST' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move CUSTMAST-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * I/O Routines for the OUTPUT File...                           *
      *****************************************************************
       CUSEXTSV-WRITE.
           if  CUSEXTSV-OPEN-FLAG = 'C'
               perform CUSEXTSV-OPEN
           end-if
           write CUSEXTSV-REC
           if  CUSEXTSV-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  CUSEXTSV-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 CUSEXTSV' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move CUSEXTSV-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       CUSEXTSV-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open OUTPUT CUSEXTSV-FILE
           if  CUSEXTSV-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to CUSEXTSV-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with CUSEXTSV' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move CUSEXTSV-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       CUSEXTSV-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close CUSEXTSV-FILE
           if  CUSEXTSV-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to CUSEXTSV-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with CUSEXTSV' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
               move CUSEXTSV-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.

      *****************************************************************
      * Display CONSOLE messages...                                   *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TEXT.
           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   *
      * 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 Enterprises                 *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2007-02-19  Generation Time: 22:38:47:56    *
      *****************************************************************

The COBOL Conversion Routine
(Next) (Previous) (Table-of-Contents)

The following (CUSEXTR1.CBL) is a COBOL program that extracts the fields of data and expands the numeric fields and truncates the trailing spaces from text fields and builds a comma separated text string of data. The program was tested using Micro Focus Enterprise Server on Windows/XP. The program was successfully executed in both an EBCDIC and ASCII encoded configuration.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CUSEXTR1.
       AUTHOR.        SIMOTIME ENTERPRISES.
      *****************************************************************
      *           This routine was generated by SimoREC1              *
      *             A product of SimoTime Enterprises                 *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *  Generation Date: 2007/02/19  Generation Time: 22:38:47:96    *
      *****************************************************************
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  NUMB-07-00           pic 9(07)       value 0.

       01  IX-P1                pic 9(9)      value 0.
       01  IX-L1                pic 9(9)      value 0.
       01  DELIMITER-BYTE       pic X         value ','.
       01  O-FLAG               pic X(3)      value 'CSV'.
      *
      *****************************************************************
       LINKAGE SECTION.
       01  EXTPUTR1-REC pic X(00256).
       COPY CUSTCB01.
      *
      *****************************************************************
       PROCEDURE DIVISION using EXTPUTR1-REC
                                CUST-RECORD.
           add 1 to ZERO giving IX-P1
           move SPACES to EXTPUTR1-REC
      *    String Move...
           add 00012 to ZERO giving IX-L1
           move CUST-NUMBER to EXTPUTR1-REC(IX-P1:IX-L1)
           perform CALCULATE-NEXT-POSITION
      *    String Move...
           add 00001 to ZERO giving IX-L1
           move CUST-STATUS to EXTPUTR1-REC(IX-P1:IX-L1)
           perform CALCULATE-NEXT-POSITION
      *    String Move...
           add 00028 to ZERO giving IX-L1
           move CUST-LAST-NAME to EXTPUTR1-REC(IX-P1:IX-L1)
           perform CALCULATE-NEXT-POSITION
      *    String Move...
           add 00020 to ZERO giving IX-L1
           move CUST-FIRST-NAME to EXTPUTR1-REC(IX-P1:IX-L1)
           perform CALCULATE-NEXT-POSITION
      *    String Move...
           add 00020 to ZERO giving IX-L1
           move CUST-MID-NAME to EXTPUTR1-REC(IX-P1:IX-L1)
           perform CALCULATE-NEXT-POSITION
      *    String Move...
           add 00048 to ZERO giving IX-L1
           move CUST-ADDRESS-1 to EXTPUTR1-REC(IX-P1:IX-L1)
           perform CALCULATE-NEXT-POSITION
      *    String Move...
           add 00048 to ZERO giving IX-L1
           move CUST-ADDRESS-2 to EXTPUTR1-REC(IX-P1:IX-L1)
           perform CALCULATE-NEXT-POSITION
      *    String Move...
           add 00028 to ZERO giving IX-L1
           move CUST-CITY to EXTPUTR1-REC(IX-P1:IX-L1)
           perform CALCULATE-NEXT-POSITION
      *    String Move...
           add 00028 to ZERO giving IX-L1
           move CUST-STATE to EXTPUTR1-REC(IX-P1:IX-L1)
           perform CALCULATE-NEXT-POSITION
      *    String Move...
           add 00012 to ZERO giving IX-L1
           move CUST-POSTAL-CODE to EXTPUTR1-REC(IX-P1:IX-L1)
           perform CALCULATE-NEXT-POSITION
      *    String Move...
           add 00018 to ZERO giving IX-L1
           move CUST-PHONE-WORK to EXTPUTR1-REC(IX-P1:IX-L1)
           perform CALCULATE-NEXT-POSITION
      *    String Move...
           add 00018 to ZERO giving IX-L1
           move CUST-PHONE-CELL to EXTPUTR1-REC(IX-P1:IX-L1)
           perform CALCULATE-NEXT-POSITION
      *    Packed Expansion...
           add 00007 to ZERO giving IX-L1
           if CUST-CREDIT-LIMIT is NUMERIC
              add CUST-CREDIT-LIMIT to ZERO giving NUMB-07-00
           else
              move ZERO to NUMB-07-00
           end-if
           move NUMB-07-00 to EXTPUTR1-REC(IX-P1:IX-L1)
           perform CALCULATE-NEXT-POSITION
           GOBACK.
      *
      *****************************************************************
       CALCULATE-NEXT-POSITION.
           if  O-FLAG = 'CSV'
               add IX-L1 to IX-P1
               if  IX-P1 > 1
                   perform until EXTPUTR1-REC(IX-P1 - 1:1) not = SPACE
                     subtract 1 from IX-P1
                   end-perform
               end-if
               move DELIMITER-BYTE to EXTPUTR1-REC(IX-P1:1)
               add 1 to IX-P1
           else
               add IX-L1 to IX-P1
           end-if
           exit.

Summary
(Next) (Previous) (Table-of-Contents)

The purpose of this program is to provide an example for accessing a VSAM, KSDS and extracting data that is reformatted into a comma separated data string that is written to a sequential file.

Software Agreement and Disclaimer
(Next) (Previous) (Table-of-Contents)

Permission to use, copy, modify and distribute this software for any commercial purpose requires a fee to be paid to SimoTime Enterprises. Once the fee is received by SimoTime the latest version of the software 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 Enterprises.

Permission to use, copy, modify and distribute this software for a non-commercial purpose and without fee is hereby granted, 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 Enterprises.

SimoTime Enterprises makes no warranty or representations about the suitability of the software for any purpose. It is provided "AS IS" without any express or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Enterprises 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.

Downloads and Links to Similar Pages
(Next) (Previous) (Table-of-Contents)

This suite of programs is part of the File Maintenance package for the Customer Master File. You may download this at http://www.simotime.com/sim4dzip.htm#cumast01 or view the complete list of SimoTime Examples at http://www.simotime.com/sim4dzip.htm .

Note: You must be attached to the Internet to download a Z-Pack or view the list.

The SimoZAPS Utility Program has the capability of generating a COBOL program that will do the conversion of sequential and VSAM (KSDS) files between EBCDIC and ASCII. SimoZAPS can also read a sequential file in EBCDIC format and create an ASCII/CRLF file or VSAM KSDS file in ASCII format. The conversion tables may be viewed or modified to meet unique requirements. The Hexcess/2 function provides the capability of viewing, finding or patching the contents of a file in hexadecimal.

Check out  The VSAM - QSAM Connection  for more examples of mainframe VSAM and QSAM accessing techniques and sample code.

This document provides a brief oveview of the Micro Focus File Formats  available on a Windows or UNIX System.

This document provides a quick summary of the  File Status Key  for VSAM data sets and QSAM files.

To review all the information available on this site start at  The SimoTime Home Page .

Glossary of Terms
(Next) (Previous) (Table-of-Contents)

Check out  The SimoTime Glossary  for a list of terms and definitions used in the documents provided by SimoTime.

Comments or Suggestions
(Next) (Previous) (Table-of-Contents)

If you have any questions, suggestions or comments please call or send an e-mail to: helpdesk@simotime.com

We appreciate your comments and feedback.

About SimoTime Enterprises, LLC
(Next) (Previous) (Table-of-Contents)

Founded in 1987, SimoTime Enterprises is a privately owned, Limited Liability Corporation located in Novato, California. 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. This includes the smallest thin client using the Internet and the very large mainframe systems. There is more to making the Internet work for your company's business than just having a nice looking WEB site. It is about combining the latest technologies and existing technologies with practical business experience. It's about the business of doing business and looking good in the process. 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 complimentary manner with existing corporate mainframe systems. 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
Copyright © 1987-2007 SimoTime Enterprises, LLC  All Rights Reserved
When technology complements business
http://www.simotime.com
Version 06.11.01