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

VSAM Status Code 92


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

New User


Joined: 19 Apr 2012
Posts: 8
Location: India

PostPosted: Mon Aug 06, 2012 1:27 pm
Reply with quote

I am creating the fresh VSAM file using IDCAMS and initializing it with a Low value record using a utility(in house utility of my shop).


Case 1:
Now In my Cobol program I am opening the VSAM file in I-O mode with access as "Sequential" in Select clause
And writing a record to the VSAM file. But at the time of Write, I am getting VSAM file Status as 92

Case 2:
Doing the same as in case1 except now I have defined access as "Random" in select clause for the VSAM.
Now its working fine and records are successfully written.

So I was wondering what causes the File status 92 in case1.


Thanks in Advance

Regards
Sumit
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 06, 2012 2:06 pm
Reply with quote

Since it is a Cobol question, what does the Cobol manual say about the exact Cobol I/O statements that you are using?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Aug 06, 2012 2:13 pm
Reply with quote

what kind of vsam file is it?

here is a description of the write statement for a vsam ksds file.
notice that talks about release order (order of records written)
with sequential access.
are you releasing records in order?
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Mon Aug 06, 2012 2:36 pm
Reply with quote

May be this could help - ibmmainframes.com/post-65013.html
Back to top
View user's profile Send private message
Sumit Jindal

New User


Joined: 19 Apr 2012
Posts: 8
Location: India

PostPosted: Mon Aug 06, 2012 2:46 pm
Reply with quote

Hello Dbz,

VSAM is the KSDS, With key length of 5.
Yes I know for writing, when access is "SEQUENTIAL" records must
be released in ascending order of the record key values.
When access is "RANDOM" or "DYNAMIC", records may be released in any programmer-specified order.

But I am am writing the records in Ascending order only and moreover I am getting the status code 92 even for my first write step.

My Input Sequential file is like:
11111 AAAA
22222 BBBB
33333 CCCC
44444 DDDD
55555 EEEE
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Aug 06, 2012 2:51 pm
Reply with quote

gylbharat wrote:
May be this could help - ibmmainframes.com/post-65013.html


actually, NO!

the referenced thread speaks of READ,
while this thread is about WRITE.

the (il)logic error is obvious,
and with a little reading the TS will probably/hopefully
come to understand the problem
that he created with his file definition.

Sumit Jindal,
don't you already have a record in the vsam file prior to opening?
Back to top
View user's profile Send private message
Sumit Jindal

New User


Joined: 19 Apr 2012
Posts: 8
Location: India

PostPosted: Mon Aug 06, 2012 3:42 pm
Reply with quote

yes DBZ, like I mentioned, After creating the KSDS file using IDCAMS.
I have initialized it with a Low value record.


Thanks
Sumit
Back to top
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Mon Aug 06, 2012 3:56 pm
Reply with quote

Whats so special with your program that you cant post the code, and I mean the Real code?!
I think there is a lot of help available, if we know a bit more, not just guess.
Back to top
View user's profile Send private message
Sumit Jindal

New User


Joined: 19 Apr 2012
Posts: 8
Location: India

PostPosted: Mon Aug 06, 2012 5:29 pm
Reply with quote

Hi, My logic is as below:

(Select Clause for Output file)
Code:
SELECT FILE-OUT1 ASSIGN TO DD1                 
                  ORGANIZATION IS INDEXED       
                  ACCESS IS SEQUENTIAL               
                  RECORD KEY IS <key>
                  FILE STATUS IS <Status key>


(Input Sequential File)
Code:
FD  IN-SEQ                                       
      DATA RECORD IS INPUT-RECORD.           
01  INPUT-RECORD                      PIC X(10).



(output VSAM KSDS File)

Code:
FD  FILE-OUT1                                       
    DATA RECORD IS OUTPUT-RECORD.           
01  OUTPUT-RECORD.                         
       05  OUT1-PRIMARY-KEY        PIC X(05).
       05  OUT1-DATA                    PIC X(05).

(Program Logic)
Code:
PERFORM A100-OPEN.               
    PERFORM B100-READ           
          UNTIL SEQ-EOF-Y.             
    PERFORM C100-CLOSE                                             
************************
 A100-OPEN.                                               
     OPEN I-O FILE-OUT1.           
     OPEN INPUT IN-SEQ.         
                       
************************
 B100-READ-FILES.
      READ IN-SEQ                   
            AT END                     
            SET SEQ-EOF-Y TO TRUE   
            GO TO B100-READ-FILES-EXIT 
       END-READ.                                                               
     PERFORM D100-WRITE.           
     
***********************
 D100-WRITE.                           
     MOVE INPUT-RECORD TO OUTPUT-RECORD 
     WRITE OUTPUT-RECORD.
                                       
***********************


Code'd
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 06, 2012 5:35 pm
Reply with quote

Why don't you use the FILE-STATUS that you coded? For VSAM files there is an extended file status as well. Good practice to use that also.
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: Mon Aug 06, 2012 11:08 pm
Reply with quote

Sumit Jindal, have you reveiwed Table 50 in the COBOL Language Reference manual (link at the top of this page)? If not, you might want to review it and then you'll have the answer to your question in your initial post.
Back to top
View user's profile Send private message
Sumit Jindal

New User


Joined: 19 Apr 2012
Posts: 8
Location: India

PostPosted: Tue Aug 07, 2012 9:40 am
Reply with quote

Hi Robert,

By looking at link you suggested I got, We cant use the WRITE statement in the KSDS & RRDS when File is opened in I-O mode and access is SEQUENTIAL.

Thanks a lot !!!!


---------
Sumit Jindal
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: Tue Aug 07, 2012 5:30 pm
Reply with quote

Glad to hear you've learned something, and you have an answer to your query.
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 VSAM LISTCAT INFORMATION JCL & VSAM 2
No new posts How to turn off 'ACTION' SDSF output ... TSO/ISPF 2
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top