COBOL Copy File
 The Replacing Function
When technology complements business    Copyright © 1987-2012  SimoTime Enterprises  All Rights Reserved
  Table of Contents Version 10.11.01 
  Introduction
  The COBOL Copy File
  The COBOL Source Code, Sample Program
  The COBOL Compile Listing
  Summary
  Software Agreement and Disclaimer
  Downloads and Links to Similar Pages
  Downloads and Links, Internet Access Required
  Downloads and Links, Local Access
  Glossary of Terms
  Comments, Suggestions or Feedback
  Company Overview
The SimoTime Home Page

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

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.

The COBOL Copy File
(Next) (Previous) (Table-of-Contents)

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-2012 SimoTime Enterprises          *
      *                     All Rights Reserved                       *
      *              Provided by SimoTime Enterprises                 *
      *        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 *
      *****************************************************************
      *

The COBOL Source Code, Sample Program
(Next) (Previous) (Table-of-Contents)

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-2012 '.
           05  C3 pic X(28) value '--- SimoTime Enterprises ---'.
           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 softwar'.
           05  C3 pic X(32) value 'e provided from SimoTime Enterpr'.
           05  C4 pic X(04) value 'ises'.

       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 Enterprises         *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************

The COBOL Compile Listing
(Next) (Previous) (Table-of-Contents)

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: NOLIST NOASMLIST OMF(OBJ) GNT(.\) OBJ(.\) OMF(GNT)
*          obj"c:\SimoSAM1\DEVL\HOLD\GNTA\" gnt"c:\SimoSAM1\DEVL\HOLD\GNTA\"
*          USE(c:\SimoSAM1\DEVL\DIRS\ASC1\OS390AscCBLBAT.DIR)
*          LISTPATH(c:\SimoSAM1\DEVL\LIST)
* Setting: NOACCEPTREFRESH ADV ALIGN"8" ALPHASTART"1" ALTER NOAMODE ANIM
*          NOANIMPREP ANS85 APOST AREACHECK ARITHMETIC"OS390" ASSIGN"EXTERNAL"
*          NOASSIGN-PRINTER NOAUTOLOCK NOBELL BINLIT"NUMERIC" NOBOUND NOBRIEF
*          NOBS2000 BWZSTAR BYTEMODEMOVE CALLFH"EXTFH" NOCALLMCS
*          NOCALLRECOVERY CALLSORT"EXTSM" CANCEL CANCELLBR NOCHANGEMESSAGE
*          CHARSET"ASCII" CHECKDIV"OS390" NOCHECKREFMOD NOCICS CICS-CPY
*          NOCICSOPTIMIZE NOCMPR2 COBFSTATCONV COBIDY"$COBIDY" NOCOBOL370
*          COBOLDIR NOCOMP COMP-5"2" COMP-6"2" COMS85 NOCONFIRM NOCONVERTRET
*          CONVSPACE COPYEXT"CBL,CPY" COPYLBR COPYLIST COPYLISTCOMMENT"7" CSI
*          CURRENCY-SIGN"36" CURRENT-DATE"MMDDYY" NODATA DATACOMPRESS"0"
*          NODATA-CONTEXT DATE DBCHECK DBCS"3" DBCSSOSI"14""15" DBSPACE
*          DE-EDIT"2" DEFAULTBYTE"32" NODEFAULTCALLS DETECTLOCK NODG DIALECT
*          "OS390" NODIRECTIVES-IN-COMMENTS NODOSVS NODOTNET DPCINSUBSCRIPT
*          NODYNAM NOEARLY-RELEASE ECHO NOECHOALL NOEDITOR ENSUITE"0"
*          NOENTCOBOL ERRFORMAT"1" ERRLIST"VERBOSE" NOERRQ NOFASTINIT FASTSORT
*          NOFCD3 NOFCDALIGN NOFCDREG FDCLEAR"1" NOFILESHARE FILETYPE"0" FLAG
*          "OS390" FLAGAS"S" FLAGCD"W" NOFLAGEUC NOFLAGMIG NOFLAGQ FLAGSINEDIT
*          NOFLAGSTD FOLDCALLNAME"UPPER" FOLDCOPYNAME"UPPER" NOFORM
*          FP-ROUNDING"OS390" HOSTARITHMETIC HOSTCONTZERO HOST-NUMCOMPARE"2"
*          HOST-NUMMOVE"2" NOHOSTFD NOHOSTRW IBMCOMP IDXFORMAT"8" NOIGNOREEXEC
*          NOIL NOILGEN IMPLICITSCOPE INDD"SYSIN 80 R" INFORETURN"0"
*          NOINITCALL NOINITPTR INT"c:\SimoSAM1\DEVL\COBOL\CPYREPC1.int"
*          INTDATE"ANSI" INTLEVEL"2" IOCONV NOISO2002 NOIXNLSKEY NOIXNUMKEY
*          KEEP-INT KEYCHECK KEYCOMPRESS"0" NOLIBRARIAN NOLINE-COUNT LIST
*          "CPYREPC1.lst" LISTPATH"c:\SimoSAM1\DEVL\LIST" LISTWIDTH"80"
*          LITVAL-SIZE"4" NOLOCALSOURCEFORMAT LOCKTYPE"0" MAPNAME NOMAXERROR
*          METHODDEFAULT"REFERENCE" NOMF NOMFCOMMENT NOMOVELENCHECK NOMS NOMVS
*          NATIVE"ASCII" NONATIVEFLOATINGPOINT NONCHAR NONEWBASENAME NONLS
*          NSYMBOL"DBCS" NOODOOSVS ODOSLIDE NOOLDBLANKLINE NOOLDCOPY
*          NOOLDINDEX NOOLDNEXTSENTENCE NOOLDREADINTO NOOLDSTRMIX OOCTRL
*          "-C-E-G-P+Q+R-S+W" NOOPTIONAL-FILE OS390 OSEXT"cbl" NOOSVS OUTDD
*          "SYSOUT 121 L" NOP64 NOPANVALET NOPC1 PERFORM-TYPE"OS390"
*          NOPREPLIST NOPREPROCESS NOPRINT-EXT NOPROFILE NOPROGID-COMMENT
*          NOPROGID-INT-NAME NOPROTECT-LINKAGE PROTOTYPE"RELAXED" QUAL
*          QUALPROC NOQUERY NOQUOTE NORAWLIST NORDW RECMODE"OS390" NOREENTRANT
*          NOREF NOREFNO REMAINDER"2" REPORT-LINE"256" RESEQ NORETRYLOCK
*          REWRITE-LS NORM RTNCODE-SIZE"2" NORWHARDPAGE NOSAA NOSEG NOSEQCHK
*          SEQUENTIAL"RECORD" NOSERIAL SETTING"LINE" SHAREOUTDD NOSHOW-DIR
*          SIGN"ASCII" NOSIGNDISCARD NOSIGNFIXUP SORTTYPE"DFSORT" SOURCEFORMAT
*          "FIXED" SOURCETABSTOP"8" NOSPZERO NOSSRANGE NOSTDERR STICKY-LINKAGE
*          "2" NOSTICKY-PERFORM SUPFF SWITCHTYPE"1" SYMBSTART"1" SYSPUNCH"80"
*          TERMPAGE TIME NOTRACE NOTRUNC TRUNCCALLNAME"8" TRUNCCOPY"8"
*          TRUNCINC"10" UNICODE"NATIVE" VERBOSE NOVISUALSTUDIO NOVSC2 WARNING
*          "3" NOWB NOWB2 NOWB3 WEBSERVER"CGI" NOWRITELOCK NOWRITETHRU 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-2012 '.
    17     05  C3 pic X(28) value '--- SimoTime Enterprises ---'.
    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 softwar'.
    23     05  C3 pic X(32) value 'e provided from SimoTime Enterpr'.
    24     05  C4 pic X(04) value 'ises'.
    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-2012 SimoTime Enterprises          *
    39*                     All Rights Reserved                       *
    40*              Provided by SimoTime Enterprises                 *
    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*    CASEVARY, End of Copy File...
    50*
    51***  CASEVARY - End-of-Copy File - - - - - - - - - - - CASEVARY *
    52*****************************************************************
    53*
    54
    55* The following uses the same copy file to create three uniquely
    56* named buffers or data structures of identical format.
    57*copy CPYREPB1 replacing ==:ZZZZ:== by ==WORK==.
    58*****************************************************************
    59*               CPYREPB1.CPY - a COBOL Copy File                *
    60*      A COPY Replace Template used by the Demo programs.       *
    61*         Copyright (C) 1987-2012 SimoTime Enterprises          *
    62*                     All Rights Reserved                       *
    63*              Provided by SimoTime Enterprises                 *
    64*        Our e-mail address is: helpdesk@simotime.com           *
    65*     Also, visit our Web Site at http://www.simotime.com       *
    66*****************************************************************
    67* The following is used with a copy statement with replace to
    68* create a multiple number of uniquely named data structures of
    69* similar format.
    70*
    71 01  WORK-BUFFER.
    72     05  WORK-01        pic x      value SPACE.
    73     05  WORK-02        pic x(2)   value SPACES.
    74     05  WORK-03        pic x(3)   value SPACES.
    75*    CPYREPB1, End of Copy File...
    76*
    77***  CPYREPB1 - End-of-Copy File - - - - - - - - - - - CPYREPB1 *
    78*****************************************************************
    79*
    80*copy CPYREPB1 replacing ==:ZZZZ:== by ==TEST==.
    81*****************************************************************
    82*               CPYREPB1.CPY - a COBOL Copy File                *
    83*      A COPY Replace Template used by the Demo programs.       *
    84*         Copyright (C) 1987-2012 SimoTime Enterprises          *
    85*                     All Rights Reserved                       *
    86*              Provided by SimoTime Enterprises                 *
    87*        Our e-mail address is: helpdesk@simotime.com           *
    88*     Also, visit our Web Site at http://www.simotime.com       *
    89*****************************************************************
    90* The following is used with a copy statement with replace to
    91* create a multiple number of uniquely named data structures of
    92* similar format.
    93*
    94 01  TEST-BUFFER.
    95     05  TEST-01        pic x      value SPACE.
    96     05  TEST-02        pic x(2)   value SPACES.
    97     05  TEST-03        pic x(3)   value SPACES.
    98*    CPYREPB1, End of Copy File...
    99*
   100***  CPYREPB1 - End-of-Copy File - - - - - - - - - - - CPYREPB1 *
   101*****************************************************************
   102*
   103*copy CPYREPB1 replacing ==:ZZZZ:== by ==LAST==.
   104*****************************************************************
   105*               CPYREPB1.CPY - a COBOL Copy File                *
   106*      A COPY Replace Template used by the Demo programs.       *
   107*         Copyright (C) 1987-2012 SimoTime Enterprises          *
   108*                     All Rights Reserved                       *
   109*              Provided by SimoTime Enterprises                 *
   110*        Our e-mail address is: helpdesk@simotime.com           *
   111*     Also, visit our Web Site at http://www.simotime.com       *
   112*****************************************************************
   113* The following is used with a copy statement with replace to
   114* create a multiple number of uniquely named data structures of
   115* similar format.
   116*
   117 01  LAST-BUFFER.
   118     05  LAST-01        pic x      value SPACE.
   119     05  LAST-02        pic x(2)   value SPACES.
   120     05  LAST-03        pic x(3)   value SPACES.
   121*    CPYREPB1, End of Copy File...
   122*
   123***  CPYREPB1 - End-of-Copy File - - - - - - - - - - - CPYREPB1 *
   124*****************************************************************
   125*
   126
   127*****************************************************************
   128 PROCEDURE DIVISION.
   129     move 0 to RETURN-CODE
   130     perform Z-POST-COPYRIGHT
   131
   132*    Move lower case letters to WORK-BUFFER and display contents
   133*    by indivdual fields within buffer.
   134     move 'a' to WORK-01
   135     move 'ab' to WORK-02
   136     move 'abc' to WORK-03
   137     display WORK-01
   138     display WORK-02
   139     display WORK-03
   140
   141*    Move the lower-case content of the WORK-BUFFER to the
   142*    TEST-BUFFER. The three inspect statements will do a lower to
   143*    UPPER case conversion of the letters a, b and c. To convert
   144*    the entire alphabet would take 26 inspect statements.
   145     move WORK-BUFFER to TEST-BUFFER
   146     inspect TEST-BUFFER replacing all 'a' by 'A'
   147     inspect TEST-BUFFER replacing all 'b' by 'B'
   148     inspect TEST-BUFFER replacing all 'c' by 'C'
   149     display TEST-01
   150     display TEST-02
   151     display TEST-03
   152
   153*    Move the UPPER-case content of the TEST-BUFFER to the
   154*    STOP-BUFFER. The single inspect statements will do an UPPER
   155*    to lower case conversion.
   156     move TEST-BUFFER to LAST-BUFFER
   157     inspect LAST-BUFFER converting UPPER-CASE to LOWER-CASE
   158     display LAST-01
   159     display LAST-02
   160     display LAST-03
   161
   162*    At this point the lower case content of the primary
   163*    WORK-BUFFER should equal the content of the STOP-BUFFER
   164*    that is the result of multiple conversions of the data that
   165*    wraps around back to lower case content.
   166     if  LAST-BUFFER = WORK-BUFFER
   167         display '* CPYREPC1 is Finished...'
   168         move 0 to RETURN-CODE
   169     else
   170         display '* CPYREPC1 is ABENDING...'
   171         move 16 to RETURN-CODE
   172     end-if
   173
   174     perform Z-THANK-YOU.
   175
   176     GOBACK.
   177
   178*****************************************************************
   179 Z-POST-COPYRIGHT.
   180     display SIM-TITLE
   181     display SIM-COPYRIGHT
   182     exit.
   183
   184*****************************************************************
   185 Z-THANK-YOU.
   186     display SIM-THANKS-01
   187     display SIM-THANKS-02
   188     exit.
   189*****************************************************************
   190*      This example is provided by SimoTime Enterprises         *
   191*        Our e-mail address is: helpdesk@simotime.com           *
   192*     Also, visit our Web Site at http://www.simotime.com       *
   193*****************************************************************
*
* Program-Id : CPYREPC1
* Line   Data Name                       Address    Size      Attributes
* 000009 SIM-TITLE . . . . . . . . . . . 0000000352 00000079  WS G    AlphNum
* 000010 T1. . . . . . . . . . . . . . . 0000000352 00000011  WS E    AlphNum
* 000011 T2. . . . . . . . . . . . . . . 0000000363 00000034  WS E    AlphNum
* 000012 T3. . . . . . . . . . . . . . . 0000000397 00000010  WS E    AlphNum
* 000013 T4. . . . . . . . . . . . . . . 0000000407 00000024  WS E    AlphNum
* 000014 SIM-COPYRIGHT . . . . . . . . . 0000000432 00000079  WS G    AlphNum
* 000015 C1. . . . . . . . . . . . . . . 0000000432 00000011  WS E    AlphNum
* 000016 C2. . . . . . . . . . . . . . . 0000000443 00000020  WS E    AlphNum
* 000017 C3. . . . . . . . . . . . . . . 0000000463 00000028  WS E    AlphNum
* 000018 C4. . . . . . . . . . . . . . . 0000000491 00000020  WS E    AlphNum
* 000020 SIM-THANKS-01 . . . . . . . . . 0000000512 00000079  WS G    AlphNum
* 000021 C1. . . . . . . . . . . . . . . 0000000512 00000011  WS E    AlphNum
* 000022 C2. . . . . . . . . . . . . . . 0000000523 00000032  WS E    AlphNum
* 000023 C3. . . . . . . . . . . . . . . 0000000555 00000032  WS E    AlphNum
* 000024 C4. . . . . . . . . . . . . . . 0000000587 00000004  WS E    AlphNum
* 000026 SIM-THANKS-02 . . . . . . . . . 0000000592 00000079  WS G    AlphNum
* 000027 C1. . . . . . . . . . . . . . . 0000000592 00000011  WS E    AlphNum
* 000028 C2. . . . . . . . . . . . . . . 0000000603 00000032  WS E    AlphNum
* 000029 C3. . . . . . . . . . . . . . . 0000000635 00000032  WS E    AlphNum
* 000030 C4. . . . . . . . . . . . . . . 0000000667 00000004  WS E    AlphNum
* 000047 LOWER-CASE. . . . . . . . . . . 0000000672 00000026  WS E    AlphNum
* 000048 UPPER-CASE. . . . . . . . . . . 0000000704 00000026  WS E    AlphNum
* 000071 WORK-BUFFER . . . . . . . . . . 0000000736 00000006  WS G    AlphNum
* 000072 WORK-01 . . . . . . . . . . . . 0000000736 00000001  WS E    AlphNum
* 000073 WORK-02 . . . . . . . . . . . . 0000000737 00000002  WS E    AlphNum
* 000074 WORK-03 . . . . . . . . . . . . 0000000739 00000003  WS E    AlphNum
* 000094 TEST-BUFFER . . . . . . . . . . 0000000744 00000006  WS G    AlphNum
* 000095 TEST-01 . . . . . . . . . . . . 0000000744 00000001  WS E    AlphNum
* 000096 TEST-02 . . . . . . . . . . . . 0000000745 00000002  WS E    AlphNum
* 000097 TEST-03 . . . . . . . . . . . . 0000000747 00000003  WS E    AlphNum
* 000117 LAST-BUFFER . . . . . . . . . . 0000000752 00000006  WS G    AlphNum
* 000118 LAST-01 . . . . . . . . . . . . 0000000752 00000001  WS E    AlphNum
* 000119 LAST-02 . . . . . . . . . . . . 0000000753 00000002  WS E    AlphNum
* 000120 LAST-03 . . . . . . . . . . . . 0000000755 00000003  WS E    AlphNum
* 000000 RETURN-CODE . . . . . . . . . . 0000000760 00000002  PG E    Comp         G
* 000000 SORT-RETURN . . . . . . . . . . 0000000764 00000002  PG E    Comp         G
* 000000 TALLY . . . . . . . . . . . . . 0000000768 00000004  PG E    Comp         G
* 000000 SORT-MESSAGE. . . . . . . . . . 0000000772 00000008  PG E    AlphNum      G
* 000000 SORT-FILE-SIZE. . . . . . . . . 0000000780 00000004  PG E    Comp         G
* 000000 SORT-MODE-SIZE. . . . . . . . . 0000000784 00000004  PG E    Comp         G
* 000000 SORT-CORE-SIZE. . . . . . . . . 0000000788 00000004  PG E    Comp         G
* 000000 SORT-CONTROL. . . . . . . . . . 0000000792 00000008  PG E    AlphNum      G
* 000000 SHIFT-OUT . . . . . . . . . . . 0000000800 00000001  PG E    AlphNum      G
* 000000 SHIFT-IN. . . . . . . . . . . . 0000000804 00000001  PG E    AlphNum      G
*
*
*
* Errors
* -Line- Col Code/severity Description
* Micro Focus Net Express            V6.0 revision 000 Compiler
* Copyright (C) Micro Focus IP Development Limited 1984-2011.
*                                                        REF GKR-009066005A0
* Total Messages:     0
* Data:        1952     Code:        2953

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

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 document and the links to other documents are intended to provide a choice of alternatives.

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

Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Enterprises. 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 Enterprises.

SimoTime Enterprises 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 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, documentation or training material.

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

This section includes links to documents with additional information that is beyond the scope and purpose of this document. The first sub-section requires an internet connection, the second sub-section references locally available documents.

Note:  A SimoTime License is required for the items to be made available on a local server.

Downloads and Links, Internet Access Required
(Next) (Previous) (Table-of-Contents)

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.

Download this evaluation package that describes and demonstrates the COPY REPLACING function of the COBOL compiler.

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 to interpret the results of accessing VSAM data sets and QSAM files.

Explore The Micro Focus Web Site for more information about products and services available from Micro Focus.

Downloads and Links, Local Access
(Next) (Previous) (Table-of-Contents)

The following links may be accessible without an internet connection.

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.

Explore The File Status Return Codes to interpret the results of accessing VSAM data sets and QSAM files.

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, Suggestions or Feedback
(Next) (Previous) (Table-of-Contents)

This document was created and is maintained by SimoTime Enterprises.

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

We appreciate hearing from you.

Company Overview
(Next) (Previous) (Table-of-Contents)

Founded in 1987, SimoTime Enterprises 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. 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 complementary 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
COBOL Copy File, the Replacing Function
Copyright © 1987-2012 SimoTime Enterprises  All Rights Reserved
When technology complements business
http://www.simotime.com