IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

BLOCK was invalid error in COBOL compilation.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Error to read log with rexx CLIST & REXX 11
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Error when install DB2 DB2 2
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top