COBOL Copy File
The Replacing Function
  Table of Contents  v-24.01.01 - cpyrep01.htm 
  Introduction
  COBOL Copy File
  COBOL Sample Program
  COBOL Compile Listing
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This suite of sample programs describes how to use a the REPLACING function with a COPY file statement within a COBOL program. The REPLACING function allows a programmer to use a single copy file to define multiple data structures of identical format with different field names.

Note: The COBOL language also has an INSPECT REPLACING function that is used to replace characters or text strings in a field at program execution time. For more information about this function refer to the INSPECT REPLACING document available on the SimoTime web site.


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-2024
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section COBOL Copy File

The following (CPYREPB1.cpy) is a sample of the Micro Focus COBOL demonstration program. This program was tested using Micro Focus Net Express, version 5.1 and Mainframe Express running on Windows/7.

      *****************************************************************
      *               CPYREPB1.CPY - a COBOL Copy File                *
      *      A COPY Replace Template used by the Demo programs.       *
      *         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       *
      *****************************************************************
      * The following is used with a copy statement with replace to
      * create a multiple number of uniquely named data structures of
      * similar format.
      *
       01  :ZZZZ:-BUFFER.
           05  :ZZZZ:-01        pic x      value SPACE.
           05  :ZZZZ:-02        pic x(2)   value SPACES.
           05  :ZZZZ:-03        pic x(3)   value SPACES.
      *
      ***  CPYREPB1 - End-of-Copy File - - - - - - - - - - - CPYREPB1 *
      *****************************************************************
      *

Table of Contents Previous Section Next Section COBOL Sample Program

The following (CPYREPC1.cbl) is a sample of the Micro Focus COBOL demonstration program. This program was tested using Micro Focus Net Express, version 5.1 and Mainframe Express running on Windows/7.

       IDENTIFICATION DIVISION.
       PROGRAM-ID. CPYREPC1.
       DATA DIVISION.
      *****************************************************************
       WORKING-STORAGE SECTION.
      *****************************************************************
      *    Data-structure for Title and Copyright...
      *    ------------------------------------------------------------
       01  SIM-TITLE.
           05  T1 pic X(11) value '* CPYREPC1 '.
           05  T2 pic X(34) value 'COBOL CopyFile & Replace Function '.
           05  T3 pic X(10) value ' v05.06.22'.
           05  T4 pic X(24) value ' http://www.simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CPYREPC1 '.
           05  C2 pic X(20) value 'Copyright 1987-2019 '.
           05  C3 pic X(28) value '   SimoTime Technologies    '.
           05  C4 pic X(20) value ' All Rights Reserved'.

       01  SIM-THANKS-01.
           05  C1 pic X(11) value '* CPYREPC1 '.
           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 '* CPYREPC1 '.
           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'.

      * The following copy file defines two alphabetic tables to be
      * used for case conversion.
       copy CASEVARY.

      * The following uses the same copy file to create three uniquely
      * named buffers or data structures of identical format.
       copy CPYREPB1 replacing ==:ZZZZ:== by ==WORK==.
       copy CPYREPB1 replacing ==:ZZZZ:== by ==TEST==.
       copy CPYREPB1 replacing ==:ZZZZ:== by ==LAST==.

      *****************************************************************
       PROCEDURE DIVISION.
           move 0 to RETURN-CODE
           perform Z-POST-COPYRIGHT

      *    Move lower case letters to WORK-BUFFER and display contents
      *    by indivdual fields within buffer.
           move 'a' to WORK-01
           move 'ab' to WORK-02
           move 'abc' to WORK-03
           display WORK-01
           display WORK-02
           display WORK-03

      *    Move the lower-case content of the WORK-BUFFER to the
      *    TEST-BUFFER. The three inspect statements will do a lower to
      *    UPPER case conversion of the letters a, b and c. To convert
      *    the entire alphabet would take 26 inspect statements.
           move WORK-BUFFER to TEST-BUFFER
           inspect TEST-BUFFER replacing all 'a' by 'A'
           inspect TEST-BUFFER replacing all 'b' by 'B'
           inspect TEST-BUFFER replacing all 'c' by 'C'
           display TEST-01
           display TEST-02
           display TEST-03

      *    Move the UPPER-case content of the TEST-BUFFER to the
      *    STOP-BUFFER. The single inspect statements will do an UPPER
      *    to lower case conversion.
           move TEST-BUFFER to LAST-BUFFER
           inspect LAST-BUFFER converting UPPER-CASE to LOWER-CASE
           display LAST-01
           display LAST-02
           display LAST-03

      *    At this point the lower case content of the primary
      *    WORK-BUFFER should equal the content of the STOP-BUFFER
      *    that is the result of multiple conversions of the data that
      *    wraps around back to lower case content.
           if  LAST-BUFFER = WORK-BUFFER
               display '* CPYREPC1 is Finished...'
               move 0 to RETURN-CODE
           else
               display '* CPYREPC1 is ABENDING...'
               move 16 to RETURN-CODE
           end-if

           perform Z-THANK-YOU.

           GOBACK.

      *****************************************************************
       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       *
      *****************************************************************

Table of Contents Previous Section Next Section COBOL Compile Listing

The following is a sample listing produced by the Micro Focus COBOL compiler. The listing will show the substitution based on the "REPLACING" value on the "COPY" statements. This program was tested using Micro Focus Net Express, version 5.1 and Mainframe Express running on Windows/7.

* Options: OMF(GNT) gnt"c:\SIMOSAM1\DEVL\HOLD\GNTA\"
*          USE(c:\SIMOSAM1\DEVL\DIRS\ASC1\ENTCOBOLASCCBLBAT.dir)
*          LISTPATH(c:\SIMOSAM1\DEVL\LIST)
* Setting: NOACCEPTREFRESH NOACU NOACUCOMMENT NOACUSYNC NOACU-UNDERSCORE ADV
*          ALIGN"8 OPT" ALPHASTART"1" ALTER NOAMODE ANIM ANS85 APOST AREACHECK
*          ARITH"EXTEND" ARITHMETIC"ENTCOBOL" ASSIGN"EXTERNAL"
*          NOASSIGN-PRINTER NOAUTOLOCK NOBELL BINLIT"BOOLEAN" NOBOUND NOBRIEF
*          NOBS2000 BWZSTAR BYTEMODEMOVE CALLFH"EXTFH" NOCALLRECOVERY CALLSORT
*          "EXTSM" CANCEL CANCELLBR NOCHANGEMESSAGE CHARSET"ASCII" CHECKDIV
*          "ENTCOBOL" NOCHECKREFMOD NOCICS CICS-CPY NOCICSOPTIMIZE NOCMPR2
*          COBFSTATCONV COBIDY"$COBIDY" NOCOBOL370 COBOLDIR
*          NOCOMMANDLINELINKAGE NOCOLLECTION NOCOMP COMP"BINARY" COMP1"FLOAT"
*          COMP2"FLOAT" COMP-5"2" COMP-6"2" NOCONFIRM NOCONVERTRET CONVSPACE
*          COPYEXT"CBL,CPY" COPYLBR COPYLIST COPYLISTCOMMENT"7" COPYSEARCH"MF"
*          CSI CURRENCY-SIGN"36" CURRENT-DATE"MMDDYY" NODATA DATACOMPRESS"0"
*          NODATA-CONTEXT DATAMAP"ADDR" DATE DBCHECK DBCS"3" DBCSSOSI"14""15"
*          DBSPACE DE-EDIT"2" DEFAULTBYTE"32" NODEFAULTCALLS DETECTLOCK NODG
*          DIALECT"ENTCOBOL" NODIRECTIVES-IN-COMMENTS DISPLAY"CONSOLE"
*          DISPSIGN"COMPAT" NODOSVS NODOTNET DPCINSUBSCRIPT NODYNAM
*          NOEARLY-RELEASE EBCCOLSEQ"1" ECHO NOECHOALL ENTCOBOL EOF1A
*          ERRFORMAT"1" ERRLIST"VERBOSE" NOERRQ NOFASTINIT FASTSORT FCD3
*          NOFCDALIGN NOFCDREG FDCLEAR"1" NOFILESHARE FILETYPE"0" FLAG
*          "ENTCOBOL" FLAGAS"S" NOFLAGEUC NOFLAGMIG NOFLAGQ FLAGSINEDIT
*          NOFLAGSTD FOLDCALLNAME"UPPER" FOLDCOPYNAME"UPPER" NOFORM
*          FP-ROUNDING"ENTCOBOL" HOSTARITHMETIC HOSTCONTZERO HOST-NUMCOMPARE
*          "2" HOST-NUMMOVE"2" NOHOSTFD NOHOSTRW IBMCOMP IDENTIFIERLEN"30"
*          IDXFORMAT"8" NOIGNOREEXEC NOIL NOILGEN IMPLICITSCOPE INDD
*          "SYSIN 80 R" NOIDYSRCPATH INFORETURN"0" NOINITCALL NOINITPTR
*          NOINITBYTYPE INT"c:\SIMOSAM1\DEVL\COBOL\CPYREPC1.int" INTDATE"ANSI"
*          INTLEVEL"8" IOCONV NOISO2002 NOIXNLSKEY NOIXNUMKEY NOJVMGEN
*          KEYCHECK KEYCOMPRESS"0" NOLIBRARIAN NOLINE-COUNT LIST"CPYREPC1.lst"
*          LISTPATH"c:\SIMOSAM1\DEVL\LIST" LISTWIDTH"80" LITVAL-SIZE"4"
*          NOLOCALSOURCEFORMAT LOCKTYPE"0" MAPNAME NOMAINFRAMEFLOATINGPOINT
*          NOMAXERROR METHODDEFAULT"REFERENCE" NOMF NOMFCOMMENT NOMFSYNC
*          NOMOVELENCHECK NOMS NOMVS NATIONAL"1" NATIVE"ASCII"
*          NONATIVEFLOATINGPOINT NONCHAR NONLS NONLSCURRENCYLENGTH NSYMBOL
*          "NATIONAL" NULLESCAPE NOODOOSVS ODOSLIDE NOOLDBLANKLINE NOOLDCOPY
*          NOOLDINDEX NOOLDNEXTSENTENCE NOOLDREADINTO NOOLDSTRMIX OOCTRL
*          "-C-E-G+L-P+Q+R-S+W" NOOPTIONAL-FILE NOOS390 OSEXT"cbl" NOOSVS
*          OUTDD"SYSOUT 121 L" NOP64 NOPANVALET NOPC1 PERFORM-TYPE"ENTCOBOL"
*          NOPREPLIST NOPREPROCESS PRESERVECASE NOPRINT-EXT NOPROFILE
*          NOPROGID-COMMENT NOPROGID-INT-NAME NOPROTECT-LINKAGE PROTOTYPE
*          "RELAXED" QUAL QUALPROC QUERY NOQUOTE NORAWLIST RDW RECMODE
*          "ENTCOBOL" NOREENTRANT NOREF NOREFNO REMAINDER"2" REPLACE
*          "NOKEEPSEQ" REPORT-LINE"256" RESEQ NORETRYLOCK REWRITE-LS NORM
*          RTNCODE-SIZE"2" RTNCODE-TYPE"COMP" NORWHARDPAGE NOSAA NOSEG
*          NOSEQCHK SEQUENTIAL"RECORD" NOSERIAL SETTING"LINE" SHAREOUTDD
*          NOSHOW-DIR SIGN"ASCII" SIGN"TRAILING" NOSIGNDISCARD NOSIGNFIXUP
*          SORTTYPE"DFSORT" NOSOURCEENCODING SOURCEFORMAT"FIXED" SOURCETABSTOP
*          "8" NOSPZERO NOSSRANGE NOSTDERR STICKY-LINKAGE"1" NOSTICKY-PERFORM
*          SUPFF SWITCHTYPE"1" SYMBSTART"1" SYSPUNCH"80" TERMPAGE NOTESTCOVER
*          TIME NOTRACE NOTRUNC TRUNCCALLNAME"8" TRUNCCOPY"8" TRUNCINC"10"
*          UNICODE"PORTABLE" VERBOSE NOVISUALSTUDIO NOVSC2 WARNING"3"
*          WEBSERVER"CGI" NOWRITELOCK NOWRITETHRU NOXMLGEN XMLPARSE"XMLSS"
*          NOXOPEN NOXREF ZEROLENGTHFALSE NOZEROSEQ ZWB
     1 IDENTIFICATION DIVISION.
     2 PROGRAM-ID. CPYREPC1.
     3 DATA DIVISION.
     4*****************************************************************
     5 WORKING-STORAGE SECTION.
     6*****************************************************************
     7*    Data-structure for Title and Copyright...
     8*    ------------------------------------------------------------
     9 01  SIM-TITLE.
    10     05  T1 pic X(11) value '* CPYREPC1 '.
    11     05  T2 pic X(34) value 'COBOL CopyFile & Replace Function '.
    12     05  T3 pic X(10) value ' v05.06.22'.
    13     05  T4 pic X(24) value ' http://www.simotime.com'.
    14 01  SIM-COPYRIGHT.
    15     05  C1 pic X(11) value '* CPYREPC1 '.
    16     05  C2 pic X(20) value 'Copyright 1987-2019 '.
    17     05  C3 pic X(28) value '   SimoTime Technologies    '.
    18     05  C4 pic X(20) value ' All Rights Reserved'.
    19
    20 01  SIM-THANKS-01.
    21     05  C1 pic X(11) value '* CPYREPC1 '.
    22     05  C2 pic X(32) value 'Thank you for using this program'.
    23     05  C3 pic X(32) value ' provided from SimoTime Technolo'.
    24     05  C4 pic X(04) value 'gies'.
    25
    26 01  SIM-THANKS-02.
    27     05  C1 pic X(11) value '* CPYREPC1 '.
    28     05  C2 pic X(32) value 'Please send all inquires or sugg'.
    29     05  C3 pic X(32) value 'estions to the helpdesk@simotime'.
    30     05  C4 pic X(04) value '.com'.
    31
    32* The following copy file defines two alphabetic tables to be
    33* used for case conversion.
    34*copy CASEVARY.
    35*****************************************************************
    36*               CASEVARY.CPY - a COBOL Copy File                *
    37*  Text Strings for Case Conversion used by the Demo programs.  *
    38*         Copyright (C) 1987-2019 SimoTime Technologies         *
    39*                     All Rights Reserved                       *
    40*              Provided by SimoTime Technologies                *
    41*        Our e-mail address is: helpdesk@simotime.com           *
    42*     Also, visit our Web Site at http://www.simotime.com       *
    43*****************************************************************
    44*    The following two data structures are used to convert data
    45*    strings between lower and UPPER case.
    46*
    47 01  LOWER-CASE PIC X(26) VALUE 'abcdefghijklmnopqrstuvwxyz'.
    48 01  UPPER-CASE PIC X(26) VALUE 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
    49*
    50***  CASEVARY - End-of-Copy File - - - - - - - - - - - CASEVARY *
    51*****************************************************************
    52*
    53
    54* The following uses the same copy file to create three uniquely
    55* named buffers or data structures of identical format.
    56*copy CPYREPB1 replacing ==:ZZZZ:== by ==WORK==.
    57*****************************************************************
    58*               CPYREPB1.CPY - a COBOL Copy File                *
    59*      A COPY Replace Template used by the Demo programs.       *
    60*         Copyright (C) 1987-2019 SimoTime Technologies         *
    61*                     All Rights Reserved                       *
    62*              Provided by SimoTime Technologies                *
    63*        Our e-mail address is: helpdesk@simotime.com           *
    64*     Also, visit our Web Site at http://www.simotime.com       *
    65*****************************************************************
    66* The following is used with a copy statement with replace to
    67* create a multiple number of uniquely named data structures of
    68* similar format.
    69*
    70 01  WORK-BUFFER.
    71     05  WORK-01        pic x      value SPACE.
    72     05  WORK-02        pic x(2)   value SPACES.
    73     05  WORK-03        pic x(3)   value SPACES.
    74*
    75***  CPYREPB1 - End-of-Copy File - - - - - - - - - - - CPYREPB1 *
    76*****************************************************************
    77*
    78*copy CPYREPB1 replacing ==:ZZZZ:== by ==TEST==.
    79*****************************************************************
    80*               CPYREPB1.CPY - a COBOL Copy File                *
    81*      A COPY Replace Template used by the Demo programs.       *
    82*         Copyright (C) 1987-2019 SimoTime Technologies         *
    83*                     All Rights Reserved                       *
    84*              Provided by SimoTime Technologies                *
    85*        Our e-mail address is: helpdesk@simotime.com           *
    86*     Also, visit our Web Site at http://www.simotime.com       *
    87*****************************************************************
    88* The following is used with a copy statement with replace to
    89* create a multiple number of uniquely named data structures of
    90* similar format.
    91*
    92 01  TEST-BUFFER.
    93     05  TEST-01        pic x      value SPACE.
    94     05  TEST-02        pic x(2)   value SPACES.
    95     05  TEST-03        pic x(3)   value SPACES.
    96*
    97***  CPYREPB1 - End-of-Copy File - - - - - - - - - - - CPYREPB1 *
    98*****************************************************************
    99*
   100*copy CPYREPB1 replacing ==:ZZZZ:== by ==LAST==.
   101*****************************************************************
   102*               CPYREPB1.CPY - a COBOL Copy File                *
   103*      A COPY Replace Template used by the Demo programs.       *
   104*         Copyright (C) 1987-2019 SimoTime Technologies         *
   105*                     All Rights Reserved                       *
   106*              Provided by SimoTime Technologies                *
   107*        Our e-mail address is: helpdesk@simotime.com           *
   108*     Also, visit our Web Site at http://www.simotime.com       *
   109*****************************************************************
   110* The following is used with a copy statement with replace to
   111* create a multiple number of uniquely named data structures of
   112* similar format.
   113*
   114 01  LAST-BUFFER.
   115     05  LAST-01        pic x      value SPACE.
   116     05  LAST-02        pic x(2)   value SPACES.
   117     05  LAST-03        pic x(3)   value SPACES.
   118*
   119***  CPYREPB1 - End-of-Copy File - - - - - - - - - - - CPYREPB1 *
   120*****************************************************************
   121*
   122
   123*****************************************************************
   124 PROCEDURE DIVISION.
   125     move 0 to RETURN-CODE
   126     perform Z-POST-COPYRIGHT
   127
   128*    Move lower case letters to WORK-BUFFER and display contents
   129*    by indivdual fields within buffer.
   130     move 'a' to WORK-01
   131     move 'ab' to WORK-02
   132     move 'abc' to WORK-03
   133     display WORK-01
   134     display WORK-02
   135     display WORK-03
   136
   137*    Move the lower-case content of the WORK-BUFFER to the
   138*    TEST-BUFFER. The three inspect statements will do a lower to
   139*    UPPER case conversion of the letters a, b and c. To convert
   140*    the entire alphabet would take 26 inspect statements.
   141     move WORK-BUFFER to TEST-BUFFER
   142     inspect TEST-BUFFER replacing all 'a' by 'A'
   143     inspect TEST-BUFFER replacing all 'b' by 'B'
   144     inspect TEST-BUFFER replacing all 'c' by 'C'
   145     display TEST-01
   146     display TEST-02
   147     display TEST-03
   148
   149*    Move the UPPER-case content of the TEST-BUFFER to the
   150*    STOP-BUFFER. The single inspect statements will do an UPPER
   151*    to lower case conversion.
   152     move TEST-BUFFER to LAST-BUFFER
   153     inspect LAST-BUFFER converting UPPER-CASE to LOWER-CASE
   154     display LAST-01
   155     display LAST-02
   156     display LAST-03
   157
   158*    At this point the lower case content of the primary
   159*    WORK-BUFFER should equal the content of the STOP-BUFFER
   160*    that is the result of multiple conversions of the data that
   161*    wraps around back to lower case content.
   162     if  LAST-BUFFER = WORK-BUFFER
   163         display '* CPYREPC1 is Finished...'
   164         move 0 to RETURN-CODE
   165     else
   166         display '* CPYREPC1 is ABENDING...'
   167         move 16 to RETURN-CODE
   168     end-if
   169
   170     perform Z-THANK-YOU.
   171
   172     GOBACK.
   173
   174*****************************************************************
   175 Z-POST-COPYRIGHT.
   176     display SIM-TITLE
   177     display SIM-COPYRIGHT
   178     exit.
   179
   180*****************************************************************
   181 Z-THANK-YOU.
   182     display SIM-THANKS-01
   183     display SIM-THANKS-02
   184     exit.
   185*****************************************************************
   186*      This example is provided by SimoTime Technologies        *
   187*        Our e-mail address is: helpdesk@simotime.com           *
   188*     Also, visit our Web Site at http://www.simotime.com       *
   189*****************************************************************
*
* Program-Id : CPYREPC1
* Line   Data Name                       Address    Size      Attributes
* 000009 SIM-TITLE . . . . . . . . . . . 0000000080 00000079  WS G    AlphNum
* 000010 T1. . . . . . . . . . . . . . . 0000000080 00000011  WS E    AlphNum
* 000011 T2. . . . . . . . . . . . . . . 0000000091 00000034  WS E    AlphNum
* 000012 T3. . . . . . . . . . . . . . . 0000000125 00000010  WS E    AlphNum
* 000013 T4. . . . . . . . . . . . . . . 0000000135 00000024  WS E    AlphNum
* 000014 SIM-COPYRIGHT . . . . . . . . . 0000000160 00000079  WS G    AlphNum
* 000015 C1. . . . . . . . . . . . . . . 0000000160 00000011  WS E    AlphNum
* 000016 C2. . . . . . . . . . . . . . . 0000000171 00000020  WS E    AlphNum
* 000017 C3. . . . . . . . . . . . . . . 0000000191 00000028  WS E    AlphNum
* 000018 C4. . . . . . . . . . . . . . . 0000000219 00000020  WS E    AlphNum
* 000020 SIM-THANKS-01 . . . . . . . . . 0000000240 00000079  WS G    AlphNum
* 000021 C1. . . . . . . . . . . . . . . 0000000240 00000011  WS E    AlphNum
* 000022 C2. . . . . . . . . . . . . . . 0000000251 00000032  WS E    AlphNum
* 000023 C3. . . . . . . . . . . . . . . 0000000283 00000032  WS E    AlphNum
* 000024 C4. . . . . . . . . . . . . . . 0000000315 00000004  WS E    AlphNum
* 000026 SIM-THANKS-02 . . . . . . . . . 0000000320 00000079  WS G    AlphNum
* 000027 C1. . . . . . . . . . . . . . . 0000000320 00000011  WS E    AlphNum
* 000028 C2. . . . . . . . . . . . . . . 0000000331 00000032  WS E    AlphNum
* 000029 C3. . . . . . . . . . . . . . . 0000000363 00000032  WS E    AlphNum
* 000030 C4. . . . . . . . . . . . . . . 0000000395 00000004  WS E    AlphNum
* 000047 LOWER-CASE. . . . . . . . . . . 0000000400 00000026  WS E    AlphNum
* 000048 UPPER-CASE. . . . . . . . . . . 0000000432 00000026  WS E    AlphNum
* 000070 WORK-BUFFER . . . . . . . . . . 0000000464 00000006  WS G    AlphNum
* 000071 WORK-01 . . . . . . . . . . . . 0000000464 00000001  WS E    AlphNum
* 000072 WORK-02 . . . . . . . . . . . . 0000000465 00000002  WS E    AlphNum
* 000073 WORK-03 . . . . . . . . . . . . 0000000467 00000003  WS E    AlphNum
* 000092 TEST-BUFFER . . . . . . . . . . 0000000472 00000006  WS G    AlphNum
* 000093 TEST-01 . . . . . . . . . . . . 0000000472 00000001  WS E    AlphNum
* 000094 TEST-02 . . . . . . . . . . . . 0000000473 00000002  WS E    AlphNum
* 000095 TEST-03 . . . . . . . . . . . . 0000000475 00000003  WS E    AlphNum
* 000114 LAST-BUFFER . . . . . . . . . . 0000000480 00000006  WS G    AlphNum
* 000115 LAST-01 . . . . . . . . . . . . 0000000480 00000001  WS E    AlphNum
* 000116 LAST-02 . . . . . . . . . . . . 0000000481 00000002  WS E    AlphNum
* 000117 LAST-03 . . . . . . . . . . . . 0000000483 00000003  WS E    AlphNum
* 000000 XML-TEXT. . . . . . . . . . . . 0000000000 00000001  LS E    AlphNum      G
* 000000 XML-NTEXT . . . . . . . . . . . 0000000000 00000002  LS E    AlphNum      G
* 000000 XML-NAMESPACE . . . . . . . . . 0000000000 00000001  LS E    AlphNum      G
* 000000 XML-NNAMESPACE. . . . . . . . . 0000000000 00000002  LS E    AlphNum      G
* 000000 XML-NAMESPACE-PREFIX. . . . . . 0000000000 00000001  LS E    AlphNum      G
* 000000 XML-NNAMESPACE-PREFIX . . . . . 0000000000 00000002  LS E    AlphNum      G
* 000000 XML-CODE. . . . . . . . . . . . 0000000000 00000004  PG E    Comp         G
* 000000 XML-INFORMATION . . . . . . . . 0000000000 00000004  PG E    Comp         G
* 000000 XML-EVENT . . . . . . . . . . . 0000000000 00000030  PG E    AlphNum      G
* 000000 JSON-CODE . . . . . . . . . . . 0000000000 00000004  PG E    Comp         G
* 000000 JSON-STATUS . . . . . . . . . . 0000000000 00000004  PG E    Comp         G
* 000000 RETURN-CODE . . . . . . . . . . 0000000560 00000002  PG E    Comp         G
* 000000 SORT-RETURN . . . . . . . . . . 0000000000 00000002  PG E    Comp         G
* 000000 TALLY . . . . . . . . . . . . . 0000000000 00000004  PG E    Comp         G
* 000000 SORT-MESSAGE. . . . . . . . . . 0000000000 00000008  PG E    AlphNum      G
* 000000 SORT-FILE-SIZE. . . . . . . . . 0000000000 00000004  PG E    Comp         G
* 000000 SORT-MODE-SIZE. . . . . . . . . 0000000000 00000004  PG E    Comp         G
* 000000 SORT-CORE-SIZE. . . . . . . . . 0000000000 00000004  PG E    Comp         G
* 000000 SORT-CONTROL. . . . . . . . . . 0000000000 00000008  PG E    AlphNum      G
* 000000 SHIFT-OUT . . . . . . . . . . . 0000000000 00000001  PG E    AlphNum      G
* 000000 SHIFT-IN. . . . . . . . . . . . 0000000000 00000001  PG E    AlphNum      G
*
*
*
* Errors
* -Line- Col Code/severity Description
* Micro Focus COBOL                  V5.0 revision 000 Compiler
* Copyright (C) Micro Focus 1984-2019. All rights reserved.
*                                                        REF GKR-052500000A0
* Total Messages:     0
* Data:        3152     Code:        3707

Table of Contents Previous Section Next Section Summary

The purpose of this program is to provide an example of using the "REPLACING" function within a copy file used within a COBOL program. 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.

Table of Contents Previous Section Next Section 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.

Table of Contents Previous Section Next Section Downloads and Links

This section includes links to documents with additional information that are beyond the scope and purpose of this document.

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.

Table of Contents Previous Section Next Section Current Server or Internet Access

The following links may be to the current server or to the Internet.

Note: The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the Link to Internet icon. If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the Link to Server icon.

Link to Internet   Link to Server   Explore the JCL Connection for more examples of JCL functionality with programming techniques and sample code.

Link to Internet   Link to Server   Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.

Link to Internet   Link to Server   Explore An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise Server.

Link to Internet   Link to Server   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.

Link to Internet   Link to Server   Explore The File Status Return Codes that are used to interpret the results of accessing VSAM data sets and/or QSAM files.

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

This suite of programs and documentation is available to download for review and evaluation purposes. Other uses will require a SimoTime Software License. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

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.

Table of Contents Previous Section Next Section Glossary of Terms

Link to Internet   Link to Server   Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.

Table of Contents Previous Section Next Section Contact or Feedback

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.

Table of Contents Previous Section Next Section Company Overview

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 Copy File, the Replacing Function
Copyright © 1987-2024
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com