COPYBOOK compile code MAX CC 0008



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

COPYBOOK compile code MAX CC 0008

Postby Sandeep1311 » Mon Apr 20, 2020 9:20 pm

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.
Sandeep1311
 
Posts: 6
Joined: Mon Apr 13, 2020 6:44 am
Has thanked: 1 time
Been thanked: 0 time

Re: COPYBOOK compile code MAX CC 0008

 

Re: COPYBOOK compile code MAX CC 0008

Postby Robert Sample » Mon Apr 20, 2020 9:38 pm

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.

These users thanked the author Robert Sample for the post:
Sandeep1311 (Mon Apr 20, 2020 10:06 pm)
Robert Sample
Global moderator
 
Posts: 3652
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 269 times

Re: COPYBOOK compile code MAX CC 0008

Postby Sandeep1311 » Mon Apr 20, 2020 9:59 pm

ok so copybook is never compiled without a proper COBOL program, posting source code having the copybook worked fine.
Sandeep1311
 
Posts: 6
Joined: Mon Apr 13, 2020 6:44 am
Has thanked: 1 time
Been thanked: 0 time

Re: COPYBOOK compile code MAX CC 0008

Postby Robert Sample » Mon Apr 20, 2020 10:15 pm

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.
Robert Sample
Global moderator
 
Posts: 3652
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 269 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post