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
 

 

Solve file status code 46
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
sauraso
Warnings : 1

New User


Joined: 27 Feb 2010
Posts: 16
Location: usa

PostPosted: Tue May 04, 2010 4:07 pm    Post subject: Solve file status code 46
Reply with quote

I am trying to read VSAM file sequentially in COBOL program. After certain number of records, i am getting file status as 46. In fact there are more records in file.

Could you please help me.
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: Tue May 04, 2010 4:16 pm    Post subject:
Reply with quote

ESDS or KSDS.
Via AIX or not via AIX.
How do you know that there are more records available.
What status checking does your program have.

Just a couple of minor details that might help get a solution, I'm sure there's a whole lot more that you could have told us too.
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 May 04, 2010 5:06 pm    Post subject:
Reply with quote

Quote:
i am getting file status as 46. In fact there are more records in file.
So what? A 46 does not always mean you hit end of file, so go read the manual and research the 46 file status code.
Back to top
View user's profile Send private message
sauraso
Warnings : 1

New User


Joined: 27 Feb 2010
Posts: 16
Location: usa

PostPosted: Tue May 04, 2010 5:25 pm    Post subject:
Reply with quote

READ TRANMST
AT END
MOVE "Y" TO END-OF-FILE.

I used above code to track end of file but it is going in infinite loop. so i used below code

READ TRANMST
IF T1-STATUS = '46'
MOVE "Y" TO END-OF-FILE
END-IF.

In above case program is getting terminated before reading all records.

File is KSDS. I have to read this file sequentially.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue May 04, 2010 5:29 pm    Post subject:
Reply with quote

well, let us start with a few pieces of information:
  1. JCL for step executing the cobol program
  2. select statements for file
  3. FD statements for file
  4. OPEN instruction
  5. code for your loop
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Tue May 04, 2010 5:30 pm    Post subject:
Reply with quote

What Robert said:

A 46 does not always mean you hit end of file, so go read the manual and research the 46 file status code.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue May 04, 2010 5:32 pm    Post subject:
Reply with quote

VSAM codes
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 May 04, 2010 5:36 pm    Post subject:
Reply with quote

From the COBOL Language Reference manual, section 6.1.8.9.1 on file status key:
Quote:
A sequential READ statement was attempted on a file open in the input
or I-O mode and no valid next record had been established because:

° The preceding READ statement was unsuccessful but did not cause an
at-end condition.

° The preceding READ statement caused an at-end condition.
So is your code checking for specific conditions and ignoring the error you're getting?
Back to top
View user's profile Send private message
sauraso
Warnings : 1

New User


Joined: 27 Feb 2010
Posts: 16
Location: usa

PostPosted: Tue May 04, 2010 5:43 pm    Post subject:
Reply with quote

If The preceding READ statement was unsuccessful but did not cause an
at-end condition. This might be case.

how do i check it???
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 May 04, 2010 5:50 pm    Post subject:
Reply with quote

Quote:
If The preceding READ statement was unsuccessful but did not cause an at-end condition. This might be case.
Precisely my point.

After your READ statement, your code should be something along the lines of
Code:
IF  T1-STATUS NOT = '00'
AND T1-STATUS NOT = '10'
    DISPLAY 'BAD READ FILE STATUS = ' T1-STATUS
    .
    .
    .
END-IF
Back to top
View user's profile Send private message
sauraso
Warnings : 1

New User


Joined: 27 Feb 2010
Posts: 16
Location: usa

PostPosted: Wed May 05, 2010 5:28 pm    Post subject:
Reply with quote

Hi Robert Sample,

I have followed u logic.

BAD RECORD IN FILE - file status 92

guide me.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed May 05, 2010 5:41 pm    Post subject:
Reply with quote

Code:
   | >__ ________________________________________________________ __.______________________________>< |
   |    |_ ______ __STATUS__ ____ __data-name-1__ _____________ _|                                    |
   |      |_FILE_|          |_IS_|               |_data-name-8_|                                      |
Add "data-name-8" to your file status clause and display it after the bad open.
Back to top
View user's profile Send private message
sauraso
Warnings : 1

New User


Joined: 27 Feb 2010
Posts: 16
Location: usa

PostPosted: Wed May 05, 2010 5:46 pm    Post subject:
Reply with quote

how do i code in cobol program?
Back to top
View user's profile Send private message
icetigerfan

New User


Joined: 08 Mar 2010
Posts: 11
Location: Nuremberg, Germany

PostPosted: Wed May 05, 2010 6:16 pm    Post subject:
Reply with quote

It is something like that:

******************************
INPUT-OUTPUT SECTION.
******************************
FILE-CONTROL.
*
SELECT .... ASSIGN TO .... STATUS IS data-name1 data-name-8.

data-name8 will be filled with non zero when ...

The description is located in the Language Reference for Enterprise Cobol.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed May 05, 2010 6:35 pm    Post subject:
Reply with quote

Logic error can be dissected by using the VSAM file status field. The FILE STATUS IS in the SELECT has an added field. WORKING-STORAGE fields are
Code:
           05  VSAM-FILE2-FS           PIC 9(02).
           05  VSAM-FILE2-FULL.
               10  VF02-RETURN         PIC S9(04) COMP.
               10  VF02-FUNCTION       PIC S9(04) COMP.
               10  VF02-FEEDBACK       PIC S9(04) COMP.
and you'll want to display all three fields on the 92 file status to get as much detail as possible.
Back to top
View user's profile Send private message
sauraso
Warnings : 1

New User


Joined: 27 Feb 2010
Posts: 16
Location: usa

PostPosted: Thu May 06, 2010 6:59 pm    Post subject:
Reply with quote

How do i will get value in VSAM-FILE2-FULL??

SELECT TRANMST ASSIGN TO TRANSI
FILE STATUS IS ???????
ORGANIZATION IS INDEXED
RECORD KEY IS TR-KEY
ACCESS IS SEQUENTIAL.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu May 06, 2010 7:11 pm    Post subject:
Reply with quote

File Status Clause
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu May 06, 2010 8:55 pm    Post subject:
Reply with quote

What is your problem with reading the manual? The link at the top of the page is quite simple to reach. The syntax for the full file status statement has even been pulled out of the manual and presented to you in an earlier post, so there is no excuse for you not knowing what to put in your FILE STATUS IS clause.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu May 06, 2010 9:00 pm    Post subject:
Reply with quote

"You can lead a horse to water...." icon_rolleyes.gif
Back to top
View user's profile Send private message
sauraso
Warnings : 1

New User


Joined: 27 Feb 2010
Posts: 16
Location: usa

PostPosted: Mon May 10, 2010 2:02 pm    Post subject: Reply to: Getting file status as 46
Reply with quote

Hey Robert,

please find VSAM status below

VSAM-CODE ==> RETURN: 08 COMPONENT: 0 REASON: 044
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 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 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