Status code 92 when accessing VSAM file dynamically



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Status code 92 when accessing VSAM file dynamically

Postby ankurm » Fri Apr 07, 2017 6:27 pm


PERFORM 8100-READ-A3-FILE
   THRU 8100-EXIT.      
PERFORM 8300-READ-INPUT-FILE
   THRU 8300-EXIT.      
8100-READ-A3-FILE.                      
                                         
    IF A3-OK                            
    INITIALIZE BAA3-KEY                  
    MOVE 05 TO BAA3-KEY-APL              
    MOVE ML-INST     TO BAA3-KEY-INST    
    MOVE ML-ACNT-REM TO BAA3-KEY-ACCT    
    MOVE LOW-VALUES  TO BAA3-KEY-LOW-VAL
    START IN-A3VSAM                      
      KEY >= BAA3-KEY                    
    END-START                            
           
    ELSE                                
    SET A3-EOF TO TRUE.                  
                                         
    SET A3-ACNT-SAME TO TRUE            
                                         
    PERFORM 4000-A3-EXTRACT              
      THRU 4000-EXIT                    
      UNTIL A3-ACNT-CHNG OR A3-EOF.  
                                     
8100-EXIT.                          
    EXIT.                            

4000-A3-EXTRACT
READ IN-A3VSAM NEXT RECORD                
    AT END                                
     
EVALUATE TRUE                              
WHEN A3-OK                                
 IF BAA3-KEY-INST = WS-MLN1-INST          
   AND BAA3-KEY-ACCT = WS-MLN1-ACCT        
   SET A3-FLAG-SET TO TRUE                
   ADD +1   TO WS-A3-READ-CNT              
   
                                           
   PERFORM 2100-GET-FLDNAME                
      THRU 2100-EXIT                      
    PERFORM 2200-CONVERT-DATE          
       THRU 2200-EXIT                  
                                       
    PERFORM 2300-GET-OLD-NEW-VALUE    
       THRU 2300-EXIT                  
                                       
    PERFORM 2400-GET-TELLER-VALUE      
       THRU 2400-EXIT                  
                                       
    PERFORM 9000-WRITE-OUTREC          
       THRU 9000-EXIT                  
                                       
 ELSE                                  
    SET A3-ACNT-CHNG TO TRUE          
 END-IF                                
 WHEN OTHER                            
    SET A3-EOF TO TRUE                
 END-EVALUATE.                        
4000-EXIT.
EXIT.


This is the code for reading and extracting data A3 file. This file has multiple occurences of account numbers but the code is not reading all occurences and gives file status 92. After that if I try to read data from the file it gives status code 46. I am not able to figure out what is the problem.

Thanks in advance.
ankurm
 
Posts: 3
Joined: Fri Apr 07, 2017 6:09 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Status code 92 when accessing VSAM file dynamically

Postby Robert Sample » Fri Apr 07, 2017 6:42 pm

You posted a lot of garbage without really telling us much.

Are you attempting to read an alternate index?
What is the file status code after the START?
Why would you attempt to read after getting a 92 -- the 46 says a sequential READ was attempted but no valid next record has been established (which implies that your START may not be working, or that you got a file status 92 on a prior read)?
Did you define the extended file status code for the VSAM file?
Why does your code not use the file status code since it is obviously available from your post title?

And a terminology note -- your post title says you're "accessing VSAM file dynamically". This is wrong -- you may indicate that access is dynamic to COBOL, but every READ is a random read and every READ NEXT is a sequential read, period. You cannot do anything but read randomly or sequentially -- COBOL doesn't support dynamic reads. The specific method you are using is skip sequential processing -- START to establish the location, then sequential READs of the records.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Status code 92 when accessing VSAM file dynamically

Postby ankurm » Mon Apr 10, 2017 10:09 am

I am not trying to read alternate index. Actually before posting I have removed the display that might have removeed the status code of file. I didn't try checking file status codes after START. The problem is I am not able to understand why its throwing status code 92. According to the code it should read until the key changes and read the next key after that but its throwing status code 92 after it reads all occurences of first key.
ankurm
 
Posts: 3
Joined: Fri Apr 07, 2017 6:09 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Status code 92 when accessing VSAM file dynamically

Postby NicC » Mon Apr 10, 2017 2:02 pm

It is not "throwing" anything - it is "issuing" or "giving". "Throw/throwing" are not mainframe terms.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Status code 92 when accessing VSAM file dynamically

Postby Robert Sample » Mon Apr 10, 2017 5:13 pm

According to the code it should read until the key changes and read the next key after that
This is NOT how COBOL works. When you do the START, you established the logical record sequence. When COBOL reads a record that does not match the key you specified, you will get either the AT END processing (if specified) or file status 10 (end of sequence or file). If you then attempt to read another record after getting the file status 10, you WILL get a file status 92 because you're attempting to read after end.

And I reiterate what you have been told: COBOL and the mainframe do not EVER, under any circumstances "throw" things. Mainframes in the system z series (and its predecessors) have been around for more than 50 years at this point. There is long-established terminology for mainframe events and processes, and attempting to use non-mainframe terms (such as "throw") with the mainframe shows that you are not ready to participate in mainframe fora. Learn the correct terms (many of which have been around for most or all of the 50+ years the mainframe has been around) and use them.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Status code 92 when accessing VSAM file dynamically

Postby ankurm » Tue Apr 11, 2017 10:17 am

Robert Sample wrote:
According to the code it should read until the key changes and read the next key after that
This is NOT how COBOL works. When you do the START, you established the logical record sequence. When COBOL reads a record that does not match the key you specified, you will get either the AT END processing (if specified) or file status 10 (end of sequence or file). If you then attempt to read another record after getting the file status 10, you WILL get a file status 92 because you're attempting to read after end.

And I reiterate what you have been told: COBOL and the mainframe do not EVER, under any circumstances "throw" things. Mainframes in the system z series (and its predecessors) have been around for more than 50 years at this point. There is long-established terminology for mainframe events and processes, and attempting to use non-mainframe terms (such as "throw") with the mainframe shows that you are not ready to participate in mainframe fora. Learn the correct terms (many of which have been around for most or all of the 50+ years the mainframe has been around) and use them.



Thanks for letting me know the terms. I was not aware of that as I am at a beginner level. Also for providing me the details of the reason of statis code 92.
ankurm
 
Posts: 3
Joined: Fri Apr 07, 2017 6:09 pm
Has thanked: 0 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post