Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

BLOCK was invalid error in COBOL compilation.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sureshmurali
Warnings : 1

New User


Joined: 25 Nov 2010
Posts: 70
Location: Sivakasi, India

PostPosted: Thu Jan 06, 2011 10:48 pm    Post subject: BLOCK was invalid error in COBOL compilation.
Reply with quote

Hi
This is my COBOL program :

Code:
 IDENTIFICATION DIVISION.                   
 PROGRAM-ID. PRGM1.                         
 ENVIRONMENT DIVISION.                     
 INPUT-OUTPUT SECTION.                     
 FILE-CONTROL.                             
      SELECT FILE1 ASSIGN TO DDNAME1.       
 DATA DIVISION.                             
 FILE SECTION.                             
 FD FILE1.                                 
    LABEL RECORDS ARE STANDARD.             
    BLOCK CONTAINS 6 RECORDS.               
    01  REC1 PIC IS X(80).                     
    WORKING-STORAGE SECTION.                   
    01 FLAG PIC IS X(1) VALUE IS 'N'.         
    88 EOF VALUE 'Y'.                       
    01 GRP1.                                   
          05 VAR1 PIC IS X(80).                   
    PROCEDURE DIVISION.                       
          OPEN INPUT FILE1.                       
          PERFORM UNTIL EOF                       
             READ FILE1 AT END MOVE 'Y' TO FLAG
                       NOT END DISPLAY REC1   
             END-READ     
          END-PERFORM.
          CLOSE FILE1.
          STOP RUN. 


While compiling this program, i am getting MAXCC = 12 with the following msgs.

"LABEL" was invalid. Scanning was resumed at the next area "A" item, level-number, or the start of the next clause.

"BLOCK" was invalid. Scanning was resumed at the next area "A" item, level-number, or the start of the next
clause.

The purpose of adding these statements was, i was told by my friend that " if the file was initially created with the DCB parameter BLKSIZE=400 bytes and if we refer this file in our COBOL prgm and include BLOCK CONTAINS 6 RECORDS for it (6 * 80 = 480 bytes-which is more than the actual block size in which with the file was created initially), there will be an error". To test this i was trying to write this. But above was the error.


This is the version i am using :
IBM Enterprise COBOL for z/OS 4.2.0

Please clarify

Thanks
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Jan 06, 2011 11:03 pm    Post subject: Re: BLOCK was invalid error in COBOL compilation.
Reply with quote

sureshmurali wrote:
Hi
This is my COBOL program :
FD FILE1.
LABEL RECORDS ARE STANDARD.
BLOCK CONTAINS 6 RECORDS.

While compiling this program, i am getting MAXCC = 12 with the following msgs.

"LABEL" was invalid. Scanning was resumed at the next area "A" item, level-number, or the start of the next clause.

"BLOCK" was invalid. Scanning was resumed at the next area "A" item, level-number, or the start of the next
clause.


RTFM
You have extra periods that are causing the error messages. Remove the period after FILE1 and STANDARD then try again. [/b]
Back to top
View user's profile Send private message
ridgewalker58

New User


Joined: 26 Sep 2008
Posts: 51
Location: New York

PostPosted: Fri Jan 07, 2011 9:36 am    Post subject: Reply to: BLOCK was invalid error in COBOL compilation.
Reply with quote

also code BLOCK CONTAINS 0 RECORDS Then the requirement will be satisfied by the blocksize of the INPUT FILE1
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us