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
 

 

Problem in defining and reading a sequential file.

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

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Wed Jan 24, 2007 9:39 am    Post subject: Problem in defining and reading a sequential file.
Reply with quote

Hi,

I have written a cobol program. My Input file is a varialble record length file. And the output file which i am going to create is a fixed length file.

I have defined the files as below in my program.

Code:
 ENVIRONMENT DIVISION.                       
*+*+*+*+*+*+*+*+*+*+*+                       
                                             
 INPUT-OUTPUT SECTION.                       
*=====================                       
 FILE-CONTROL.                               
                                             
        SELECT IDOC-FILE ASSIGN TO IDOC       
               ORGANIZATION  IS  SEQUENTIAL   
               FILE STATUS WW-IDOC-STATUS.   
                                             
        SELECT ODOC-FILE ASSIGN TO ODOC       
               ORGANIZATION  IS  SEQUENTIAL   
               FILE STATUS WW-ODOC-STATUS.   

 FILE SECTION.                                   
*=============                                   
 FD  IDOC-FILE                                   
     LABEL RECORDS ARE STANDARD                 
     RECORDING MODE IS V                         
     BLOCK 0 RECORDS                             
     RECORD CONTAINS 27 TO 204 CHARACTERS.       
 01  IDOC-REC                       PIC X(204). 
                                                 
 FD  ODOC-FILE                                   
     LABEL RECORDS ARE STANDARD                 
     RECORDING MODE IS F                         
     BLOCK 0 RECORDS.                           
 01  ODOC-REC                       PIC X(80).   




Code:
READ IDOC-FILE INTO IDOC-REC


I am getting 2 errors which i have pasted below.

Error 1:
IGZ0204W A file attribute mismatch was detected. File IDOC-FILE in program DOCONE was defined as RECORDING MODE V and the file specified in the ASSIGN clause did not contain the same attribute.

IGZ0201W A file attribute mismatch was detected. File IDOC-FILE in program DOCONE had a record length of 208 and the file specified in the ASSIGN clause had a record length of 204.

IGZ0201W A file attribute mismatch was detected. File ODOC-FILE in program DOCONE had a record length of 80 and the file specified in the ASSIGN clause had a record length of 204.


And when I read the record using
Code:
READ IDOC-FILE INTO IDOC-REC
i get the error message :

130 IGYPA3043-E Data-item "IDOC-REC (ALPHANUMERIC)" and record "IDOC-REC (ALPHANUMERIC)" had overlapping storage. Movement of data may not occur at execution time.

Thanks a lot in advance for the advice.

Cheers.
Back to top
View user's profile Send private message

murali922

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Wed Jan 24, 2007 9:41 am    Post subject:
Reply with quote

One more information is, when the file is opened during program execution, I get return code 39.
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Wed Jan 24, 2007 1:20 pm    Post subject:
Reply with quote

When using Variable length file, you need to consider adding 4 bytes extra to store variable record length.
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Wed Jan 24, 2007 3:19 pm    Post subject:
Reply with quote

Murali ,

The 39 file status error may be due to the mismatch of the lrecl for your physical and logical file , but let me know one thing u have given a statement like
READ IDOC-FILE INTO ODOC-REC

the target lrecl is 80 and the source lrecl is 204 if u execute this won't it give u a S0C4 abend ... Let us know the progress anyways

Cheer's,
Thamilzan
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Jan 24, 2007 3:36 pm    Post subject: Re: Problem in defining and reading a sequential file.
Reply with quote

Code:
FD  IDOC-FILE                                   
     LABEL RECORDS ARE STANDARD                 
     RECORDING MODE IS V                         
     BLOCK 0 RECORDS                             
     RECORD CONTAINS 27 TO 204 CHARACTERS.       
 01  IDOC-REC                       PIC X(208). 
 01  IDOC-REC-2                    PIC X(27). 
                                                 
 FD  ODOC-FILE                                   
     LABEL RECORDS ARE STANDARD                 
     RECORDING MODE IS F                         
     BLOCK 0 RECORDS.                           
 01  ODOC-REC                       PIC X(80).


Quote:
READ IDOC-FILE INTO IDOC-REC
Into "IDOC-REC"? If you want the data in IDOC-REC, do not us the into.

Quote:
IGZ0204W A file attribute mismatch was detected. File IDOC-FILE in program DOCONE was defined as RECORDING MODE V and the file specified in the ASSIGN clause did not contain the same attribute.

IGZ0201W A file attribute mismatch was detected. File IDOC-FILE in program DOCONE had a record length of 208 and the file specified in the ASSIGN clause had a record length of 204.
These should be taken care of by the changes above in the 01 record definitions.
Quote:
IGZ0201W A file attribute mismatch was detected. File ODOC-FILE in program DOCONE had a record length of 80 and the file specified in the ASSIGN clause had a record length of 204.
This sounds like your jcl may incorrect.
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Wed Jan 24, 2007 3:59 pm    Post subject: Re: Problem in defining and reading a sequential file.
Reply with quote

Can you please put the jcl for this?
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
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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