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
 

 

KSDS File Status - 92
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Gayathri P

New User


Joined: 07 Oct 2011
Posts: 16
Location: India

PostPosted: Mon Feb 27, 2012 12:40 pm    Post subject: KSDS File Status - 92
Reply with quote

I have converted a flat file (recl 100) into the below VSAM.
when I read that VSAM using the key (old-card), am getting logic-error '92'.

Code:
SELECT  INP-FILE            ASSIGN TO      O-INPFILE
                            ORGANIZATION IS INDEXED   
                            ACCESS MODE  IS DYNAMIC   
                            FILE STATUS  IS FILE-STAT
                            RECORD KEY   IS WS-KEY.   


 FD  INP-FILE                         
     DATA RECORD IS INPUT-RECORD.   
                                       
 01  INPUT-RECORD.                 
     05 WS-KEY.                       
        10 old-card      PIC X(16).   
     05 new-CARD         PIC X(16).   
     05 NAME             PIC X(36).   
     05 ACCT             PIC X(09).   
     05 FILLER           PIC X(22).   


05  FILE-STAT               PIC X(2)      VALUE SPACES.   
    88  WI-XREF-SUCCESSFUL             VALUE '00'.         
    88  WI-XREF-EOF                    VALUE '10'.         
    88  WI-XREF-SEQUENCE-ERROR         VALUE '21'.         
    88  WI-XREF-DUPLICATE-KEY          VALUE '22'.         
    88  WI-XREF-NOT-FOUND              VALUE '23'.         
    88  WI-XREF-NOT-SPACE              VALUE '24'.         



PROCEDURE DIVISION

MOVE ws-number TO  WS-KEY
READ INP-FILE.                             
   DISPLAY 'XREF-STAT = ' FILE-STAT         

IF WI-XREF-SUCCESSFUL
 .............
 (do processing)


Kindly help in resolving this
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Feb 27, 2012 12:55 pm    Post subject:
Reply with quote

And a code 92 is what ............
You have looked it up haven't you.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Feb 27, 2012 12:58 pm    Post subject: Reply to: KSDS STATUS - 92
Reply with quote

Also it is a Cobol rather than a VSAM question.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Feb 27, 2012 12:59 pm    Post subject:
Reply with quote

Indeed it is and has now been moved
Back to top
View user's profile Send private message
Dsingh29

Active User


Joined: 16 Dec 2008
Posts: 132
Location: IBM

PostPosted: Mon Feb 27, 2012 1:00 pm    Post subject:
Reply with quote

your input record is of 99 length while you said recl =100 for flat file, please check following to start with your error research:
1. see if KSDS is properly populated
2. check the length of your key again.
3. try to increase the length of input record.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Feb 27, 2012 1:14 pm    Post subject: Reply to: KSDS STATUS - 92
Reply with quote

I got the same byte-count as Dave. You'll have to change that anyway.

What are you going to use those 88's for? The name you've given for 24, I don't understand. From the 88's it looks like you are doing sequential reads as well.

The minimal code you have provided shows a sequential read, yet you are setting up the key.

Either you are doing a sequential read without a prior position on the file, or you are doing a keyed read with the wrong (sequential) format for the READ statement. The KEY IS to Read The Fine Manual.
Back to top
View user's profile Send private message
Gayathri P

New User


Joined: 07 Oct 2011
Posts: 16
Location: India

PostPosted: Mon Feb 27, 2012 2:02 pm    Post subject:
Reply with quote

After the read stmt I have displayed the FILE-STAT which is '92',Hence I ve raised this under VSAM .

File status 92 has given me the explanation as logical error.
As far as i checked , the key field length is correct, pos 1-16 and is correctly populated in KSDS too.

Thanks for pointing out the recl mismatch and it has been corrected.
Back to top
View user's profile Send private message
Gayathri P

New User


Joined: 07 Oct 2011
Posts: 16
Location: India

PostPosted: Mon Feb 27, 2012 2:07 pm    Post subject:
Reply with quote

The 88 Variables ,I have just given some self defined flags for various status codes of the VSAM .

Please ignore the '24' which is not applicable in this case
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Feb 27, 2012 2:11 pm    Post subject: Reply to: KSDS STATUS - 92
Reply with quote

Not "logical error" but "logic error". This means you have done somthing which does not make sense to the VSAM processing code.

In your case, when you get to the post, you have asked it to read the next record when there is no current record for VSAM to use to establish what record anyone would feel is the "next".

It is a "logic error" because your code asked VSAM to do something which does not make sense. It is a Cobol question because your code is in Cobol.

Maybe there are other exceptions, but except for an I/O error, those FILE-STATUSes you get in your program which are not those expected at the time are indicating problems with your code (sometimes it'll be the specification which is lacking, but usually you should have been able to think of those situations yourself; sometimes it'll be the file definition, which is more code that is either yours, or which you should have looked at).

EDIT: Crossed in the post. I'm not discouraging the 88s, just was curious as to whether they indicated random and sequential, and what you were expecting from the 24, which I'll now ignore. Still, the others should be adding to the information about your program...
Back to top
View user's profile Send private message
Gayathri P

New User


Joined: 07 Oct 2011
Posts: 16
Location: India

PostPosted: Mon Feb 27, 2012 2:12 pm    Post subject:
Reply with quote

Quote:
keyed read with the wrong (sequential) format for the READ statement


am afraid If I do a wrong key-read . I have provided the code how I perform the READ , can you correct it , if its wrong ? Please
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Feb 27, 2012 2:19 pm    Post subject: Reply to: KSDS STATUS - 92
Reply with quote

Click on the Manuals link at the top of the page. Choose a Cobol Language Reference. Look at Format 2 of the READ. Look at some other stuff at the same time, so you pick up something else as well.
Back to top
View user's profile Send private message
Gayathri P

New User


Joined: 07 Oct 2011
Posts: 16
Location: India

PostPosted: Mon Feb 27, 2012 3:37 pm    Post subject:
Reply with quote

Thank you Mr Bill ,
Will definitley look into the reference .

The issue is resolved now. I just corrected the line order below ,

FILE STATUS IS FILE-STAT
RECORD KEY IS WS-KEY.

to

RECORD KEY IS WS-KEY
FILE STATUS IS FILE-STAT.

and it worked out. icon_biggrin.gif

Thank you all !!!
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Feb 27, 2012 4:02 pm    Post subject: Reply to: KSDS STATUS - 92
Reply with quote

Really?

If the order mattered, I'd have expected the Compiler to notice and give you an error.

Same data? No other code changes?

You have DYNAMIC access. How do you think you are telling it to do a keyed read rather than a sequential read?
Back to top
View user's profile Send private message
Gayathri P

New User


Joined: 07 Oct 2011
Posts: 16
Location: India

PostPosted: Mon Feb 27, 2012 4:22 pm    Post subject:
Reply with quote

I havent made any other change Sir.

In the same program , I am also performing a sequential read on another file and have given the access mode as SEQUENTIAL .

For KEY-READ I have tried with both RANDOM & DYNAMIC , and now after this change both are working.

To answer your question,in DYNAMIC I have populated the key value and made the READ ,

MOVE ws-number TO WS-KEY
READ INP-FILE.


Whereas in sequential jus staright away reading till the End Of file.

READ HBO-MASTER
AT END
(come out)
NOT AT END
(process)

Thats the only difference I had made in here .
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Feb 27, 2012 4:30 pm    Post subject: Reply to: KSDS STATUS - 92
Reply with quote

OK. I'll try to find time to do a little checking, as that sounds interesting.

If you are only doing keyed reads on that file, then it is better to specify RANDOM. If doing a mix of keyed and sequential reads on that file, you must use DYNAMIC.

With DYNAMIC, READ without the KEY is going to do a sequential read.

Having said that, I've always used READ NEXT for a sequential and READ KEY for a keyed read, so can't be certain about what happens if you don't do that. It makes the program easier to read, and leave no doubt about either your intention or the compiler's actions.
Back to top
View user's profile Send private message
Gayathri P

New User


Joined: 07 Oct 2011
Posts: 16
Location: India

PostPosted: Mon Feb 27, 2012 4:42 pm    Post subject:
Reply with quote

Yes I have realized the benefit of using RANDOM here.

So far I ve been using START , READ NEXT only for the READs using PARTIAL-KEYs . Will try using READ NEXT for sequential too.

Thanks a ton for ur help icon_smile.gif
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Feb 27, 2012 7:02 pm    Post subject: Reply to: KSDS STATUS - 92
Reply with quote

For OPEN INPUT for a KSDS the default when nothing specified is a keyed read.

I have so far failed to create a '92' for keyed reads of a KSDS.

There is one change you made we forgot about, which was the length of the record.

The order of FILE STATUS and RECORD KEY makes no difference.

The 92, "logic error", should be saying "you're asking me (VSAM) to do something that does not make sense given, like writing input, reading output".

If you can make the problem return by changing the length of the record back to 99, I'd be interested in seeing a LISTCAT.

If you can't re-create it like that, then we'll get nowhere without seeing more of your code. If you like, and are allowed, you can PM me the whole thing :-)
Back to top
View user's profile Send private message
Gayathri P

New User


Joined: 07 Oct 2011
Posts: 16
Location: India

PostPosted: Mon Feb 27, 2012 7:21 pm    Post subject:
Reply with quote

Yes !!!!

Its that recl change which is causing the difference.
I have recreated the bug , by reverting that change.

I still don't understand why it dint throw me some error like file attribute mismatch or so .. during execution itself , instead the job ran fine !!!
Back to top
View user's profile Send private message
Gayathri P

New User


Joined: 07 Oct 2011
Posts: 16
Location: India

PostPosted: Mon Feb 27, 2012 7:23 pm    Post subject:
Reply with quote

I would appreciate a detail explanation for I dont have enough knowledge on compiler listing icon_neutral.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Mon Feb 27, 2012 7:46 pm    Post subject: Reply to: KSDS STATUS - 92
Reply with quote

unfortunately this is not a training forum...
if You have some/few lines that You do not understand post them and somebody will be glad to help.
but.... nothing more
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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 File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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