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: 8700
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 Unable to interpret a hex value to De... COBOL Programming 4
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts how to eliminate null indicator value... DB2 7
No new posts CA7 count with DATE variable CA Products 0
No new posts Get RECORD LENGTH, allocated space of... CLIST & REXX 7
Search our Forums:

Back to Top