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
 

 

VSAM Status Code 92

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: VSAM Status Code 92
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Mon Aug 06, 2012 2:06 pm    Post subject: Reply to: VSAM Status Code 92
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    Post subject:
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    Post subject:
Reply with quote

May be this could help - http://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    Post subject:
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    Post subject:
Reply with quote

gylbharat wrote:
May be this could help - http://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    Post subject:
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    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Mon Aug 06, 2012 5:35 pm    Post subject: Reply to: VSAM Status Code 92
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: 7913
Location: Bellevue, IA

PostPosted: Mon Aug 06, 2012 11:08 pm    Post subject:
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    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Tue Aug 07, 2012 5:30 pm    Post subject:
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    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 PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


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