Page 1 of 1

COPYBOOK compile code MAX CC 0008

PostPosted: Mon Apr 20, 2020 9:20 pm
by Sandeep1311
Hi All,

i am trying to compile a copybook, the copybook is:

EDIT       Z80076.SAMPLE.SANDEEP(F040860) - 01.03          Columns 00001 00072
Command ===>                                                  Scroll ===> PAGE
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000001        01  WS-RECORD.                                                  
000002            05 WS-NAME   PIC X(26).                                      
000003            05 WS-NUMBER PIC 9(10).                                      
000004            05 WS-AGE    PIC 9(02).                                      
****** **************************** Bottom of Data ****************************


on compile submission the Max CC is 0008 and the error is:

  ZWB                                                                          
PP 5655-EC6 IBM Enterprise COBOL for z/OS  6.3.0 P200319       CBLNAM01  Date 04
  LineID  PL SL  ----+-*A-1-B--+----2----+----3----+----4----+----5----+----6---
  000001                01  WS-RECORD.                                          
                                                                               
==000001==> IGYDS1022-E A data-name or file-name definition was found outside of
                        DIVISION".  Scanning was resumed at the next area "A" it
                        of the next entry.                                      
                                                                               
  000002                    05 WS-NAME   PIC X(26).                            
                                                                               
==000002==> IGYDS1022-E A data-name or file-name definition was found outside of
                        DIVISION"
.  Scanning was resumed at the next area "A" it
                        of the next entry.                                      
                                                                               
  000003                    05 WS-NUMBER PIC 9(10).                            
                                                                               
==000003==> IGYDS1022-E A data-name or file-name definition was found outside of
                        DIVISION".  Scanning was resumed at the next area "A" it
                        of the next entry.                                      
                                                                               
  000004                    05 WS-AGE    PIC 9(02).                            
                                                                               
==000004==> IGYDS1022-E A data-name or file-name definition was found outside of
                        DIVISION"
.  Scanning was resumed at the next area "A" it


please help out.

many thanks,
sandeep.

Re: COPYBOOK compile code MAX CC 0008

PostPosted: Mon Apr 20, 2020 9:38 pm
by Robert Sample
Are you trying to compile the copybook without a COBOL program? if so, be aware that you will NEVER be able to do this. A copybook MUST be part of an actual COBOL program; it does not stand alone.

If you have the copybook in a program, post the source code, including the COPY F040860 statement in the program.

Re: COPYBOOK compile code MAX CC 0008

PostPosted: Mon Apr 20, 2020 9:59 pm
by Sandeep1311
ok so copybook is never compiled without a proper COBOL program, posting source code having the copybook worked fine.

Re: COPYBOOK compile code MAX CC 0008

PostPosted: Mon Apr 20, 2020 10:15 pm
by Robert Sample
From the Enterprise COBOL Language Reference manual, version 6.3, page 522 (emphasis added by me):
The COPY statement is a library statement that places prewritten text in a COBOL compilation unit. Prewritten source code entries can be included in a compilation unit at compile time. Thus, an installation can use standard file descriptions, record descriptions, or procedures without recoding them. These entries and procedures can then be saved in user-created libraries; they can then be included in programs and class definitions by means of the COPY statement. Compilation of the source code containing COPY statements is logically equivalent to processing all COPY statements before processing the resulting source text. The effect of processing a COPY statement is that the library text associated with text-name is copied into the compilation unit, logically replacing the entire COPY statement, beginning with the word COPY and ending with the period, inclusive. When the REPLACING phrase is not specified, the library text is copied unchanged.