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

FILE STATUS - 39 ON VARIABLE LENGTH VSAM KSDS FILE


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mframe-guy

New User


Joined: 03 Dec 2020
Posts: 6
Location: India

PostPosted: Fri Dec 04, 2020 12:04 am
Reply with quote

Hi,

I have got a file status of -39 while the program is trying to open a VSAM - KSDS (variable length file).

Below are the details of the VSAM file as available in the program:

Code:
SELECT VSM-FILE           ASSIGN   TO    VSAMFL       
                                    ORGANIZATION IS INDEXED     
                                    ACCESS MODE IS  RANDOM       
                                    RECORD KEY   VSM-KEY         
                                    STATUS IS    WS-VSMFL-STATUS.

FD  VSM-FILE                                 
    RECORD IS VARYING IN SIZE                 
    DEPENDING ON WS-VSM-LEN.                 
01  VSM-RECORD.                               
    05 VSM-KEY                    PIC X(08). 
    05 VSM-DAT1                  PIC X(02). 
    05 VSM-DAT2                  PIC 9(03). 
    05 VSM-DAT3                  PIC X(5374).

01  WS-VSM-LEN                    PIC 9(04).


Some of the physical attributes of the variable length KSDS VSAM file:

Dataset Type: KSDS
CI Size: 4096
CI's per CA: 180
Avg Recordsize: 95
Max Recordsize: 5387
Key Length: 8
Key Offset: 0
Cross Region Shropt: 2
Cross System Shropt: 3

Please let me know if I need to provide further information.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Dec 04, 2020 12:34 am
Reply with quote

A file status 39 means the COBOL program attributes for the data set do not match the physical attributes of the data set. From the COBOL Language Reference manual:
Quote:
The OPEN statement was unsuccessful because a conflict was
detected between the fixed file attributes and the attributes specified
for that file in the program. These attributes include the
organization of the file (sequential, relative, or indexed), the prime
record key, the alternate record keys, the code set, the maximum
record size, the record type (fixed or variable), and the blocking
factor.
So you need to get a LISTCAT of the VSAM data set and compare these attributes to see which don't match and change your program.

Note: for this particular problem, the CI SIZE and shareoptions (among others) don't matter since COBOL doesn't know about them.
Back to top
View user's profile Send private message
mframe-guy

New User


Joined: 03 Dec 2020
Posts: 6
Location: India

PostPosted: Wed Dec 16, 2020 8:55 pm
Reply with quote

Thank you Robert

I had performed LISTCAT and it seems some of the attributes of the file has been changed, because the file has been DROPPED and created with new KEYLEN and total length during refresh by the application team and this i am not aware of and followed the old parameters, hence the issue.

So, I have updated my code with updated KEY length and other parameters, later it worked.

Sorry for the late response; Thanks once again
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top