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
 

 

File status code 92 for reading a vsam file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ch.prashant

New User


Joined: 16 Sep 2006
Posts: 27
Location: Hyderabad

PostPosted: Tue Sep 15, 2009 4:38 pm    Post subject: File status code 92 for reading a vsam file
Reply with quote

Hi,
I checked out this one in previous post and they have gave the answer that the file has corrupted and reload it, I did the same but it did not worked.
my code
======
FILE-CONTROL.
SELECT COTBL ASSIGN TO COTBL
RECORD KEY IS COT-KEY
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
FILE STATUS IS COTBL-FILE-STATUS.

OPEN INPUT COTBL.
DISPLAY 'FILESTATUS= ' COTBL-FILE-STATUS
READ COTBL NEXT RECORD AT END MOVE 'Y' TO WS-COTBL-IND.
IF COTBL-FILE-STATUS NOT = '00'
DISPLAY 'FILESTATUS= ' COTBL-FILE-STATUS
END-IF.
CLOSE COTBL.

it displays the following

FILESTATUS= 00
FILESTATUS= 92
COT-REC=




as it could not able to read the file.
Pls suggest me the needful.
Thanks,
Prashant
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7905
Location: Bellevue, IA

PostPosted: Tue Sep 15, 2009 4:45 pm    Post subject:
Reply with quote

Try moving LOW-VALUES to your key before doing the READ. Since you're using a dynamically accessed file, I would do a START with LOW-VALUES in the key to ensure I established the record pointer before doing a READ NEXT.

The 92 file status code (LOGIC ERROR) indicates you're attempting to read a NEXT record without having established a current record to read the next record after.
Back to top
View user's profile Send private message
ch.prashant

New User


Joined: 16 Sep 2006
Posts: 27
Location: Hyderabad

PostPosted: Tue Sep 15, 2009 4:48 pm    Post subject: Reply to: File status code 92 for reading a vsam file
Reply with quote

well i want to read the vsam file sequentially without using the key so suggest me the synatx for the file control and syntax for the read option.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7905
Location: Bellevue, IA

PostPosted: Tue Sep 15, 2009 4:51 pm    Post subject:
Reply with quote

Code:
SELECT COTBL ASSIGN TO COTBL
RECORD KEY IS COT-KEY
ORGANIZATION IS INDEXED
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS COTBL-FILE-STATUS.
then open the file for input and start reading.

ACCESS DYNAMIC requires you to establish a current record pointer before reading sequentially -- even for the first record of the file.
Back to top
View user's profile Send private message
ch.prashant

New User


Joined: 16 Sep 2006
Posts: 27
Location: Hyderabad

PostPosted: Tue Sep 15, 2009 4:55 pm    Post subject: Reply to: File status code 92 for reading a vsam file
Reply with quote

Could u give me the synatx for reading file too
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Tue Sep 15, 2009 4:56 pm    Post subject:
Reply with quote

If this is the requirement then Why to use VSAM file if you need to read it sequentially, simply use the PS file.
Reading the VSAM file sequentially simply write the READ FILE and then after read next for reading the next record
Back to top
View user's profile Send private message
ch.prashant

New User


Joined: 16 Sep 2006
Posts: 27
Location: Hyderabad

PostPosted: Tue Sep 15, 2009 4:59 pm    Post subject: Reply to: File status code 92 for reading a vsam file
Reply with quote

I have used the code u suggested
FILE-CONTROL.
SELECT COTBL ASSIGN TO COTBL
RECORD KEY IS COT-KEY
ORGANIZATION IS INDEXED
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS COTBL-FILE-STATUS.
OPEN INPUT COTBL.
DISPLAY 'FILESTATUS= ' COTBL-FILE-STATUS
READ COTBL RECORD AT END MOVE 'Y' TO WS-COTBL-IND.
IF COTBL-FILE-STATUS NOT = '00'
DISPLAY 'FILESTATUS= ' COTBL-FILE-STATUS
END-IF.
CLOSE COTBL.

the output is the same
===========

FILESTATUS= 00
FILESTATUS= 92
COT-REC=



it still showing the same.
Back to top
View user's profile Send private message
ch.prashant

New User


Joined: 16 Sep 2006
Posts: 27
Location: Hyderabad

PostPosted: Tue Sep 15, 2009 5:01 pm    Post subject: Reply to: File status code 92 for reading a vsam file
Reply with quote

Hi Ketan,

Here my file is a vsam file which i need to read for this step alone and this vsam file is used another step for index purpose so y to make complicate by converting it to falt file and read it and then repro it if we have the syntax of reading a vsam file.

Thanks ketan for ur suggestion.

Thanks,
Prashant
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7905
Location: Bellevue, IA

PostPosted: Tue Sep 15, 2009 5:02 pm    Post subject:
Reply with quote

ch.prashant: this is a help forum, not a do-your-job-for-you forum. You are presumed to be capable enough to write simple code to read a file; if you have specific issues we can help but that's about as far as we want to go.

Ketan Varhade: if the file already exists as a VSAM KSDS, which physical sequential (PS) file are you talking about in your last post? Nobody has mentioned any such file in this thread as far as I've seen.
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Tue Sep 15, 2009 5:04 pm    Post subject:
Reply with quote

Hi Robert,
I am talking about converting that file to a PS file not to process a VSAM file. I am asking the OP to use repro and simplify the process and complications
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Sep 15, 2009 5:31 pm    Post subject:
Reply with quote

Ketan Varhade wrote:
I am asking the OP to use repro and simplify the process and complications


why use resources (dasd) for another file,
when the only problem is the lack of technical expertise on the part of the TS?

Sequential reading of a vsam file is outlined in every version of the
COBOL Application Programmers Guide. Other than the Select clause,
the i/o commands are the same as reading a PS file.

and this 'give me the syntax for this' and 'give me the syntax for that'.
RTFM.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7905
Location: Bellevue, IA

PostPosted: Tue Sep 15, 2009 5:55 pm    Post subject:
Reply with quote

Ketan: not a wise thing to do. If the file has 250 million records, you're talking about a lot of time to copy the file, a lot of space to hold the file, and it may not even be possible to copy it to a sequential file (depending upon the site). While changing the problem statement can simplify (considerably in some cases) the problem solution, the post usually would not have been made if such a change were possible. We need to work with what we're told, not change the problem to something else.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7905
Location: Bellevue, IA

PostPosted: Tue Sep 15, 2009 6:05 pm    Post subject:
Reply with quote

The logic error usually means something is being attempted that cannot be done (such as opening an already open file, reading a file opened for output, writing a file opened for input, and so forth). How many records are in the VSAM file?

Your code is correct, so there's something about the file that is causing the logic error (or file and COBOL interaction). How was the file built?
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 3 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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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