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

Problem in defining and reading a sequential file.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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: 3156
Location: Tucson AZ

PostPosted: Wed Jan 24, 2007 3:36 pm
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: Canada

PostPosted: Wed Jan 24, 2007 3:59 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top