IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

VSAM Open Error 35 user abend U1001


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
baljinders

New User


Joined: 21 Aug 2006
Posts: 72

PostPosted: Fri Apr 02, 2010 6:40 am
Reply with quote

Hi,

I am getting the below error for VSAM which is already present in the system.

Code:
VSAM STATUS IS: 35
EE3250C The system or user abend U1001 R=00000000 was issued.
       From compile unit VIKIPN at entry point VIKIPN at compile unit offset +
       address 00007CCE.
> LEAID ENTERED (LEVEL 04/01/2008 AT 12.32)
> LEAID PROCESSING COMPLETE. RC=0



I am trying to read this VSAM which has two alternate indexs defined on it and copy it into a flat sequential file through cobol program. But when i run the JCL the get i the above error.

The select clause is as follows:

SELECT VSAM-File ASSIGN TO DDNAME
ORGANIZATION IS INDEXED
ACCESS MODE IS SEQUENTIAL
RECORD KEY IS PKEY
ALTERNATE RECORD KEY IS
AKEY
WITH DUPLICATES
FILE STATUS IS VSAM-STATUS.



The picture clause for AKEY is PIC X(02).

I am not using the primary key or alternate key to read records in the program. I just have to the copy the contents of the VSAM to a flat file. So i am simply reading the file sequentially till end of file and moving the records to the flat file fields.

Another thing to notice here is that if the remove the alternate index clause, the program works properly. Also the file name is correctly mapped to JCL. I have verified it.

The alternate index was created successfully using file-aid.

Can someone help me on this. I have spent lot of time to get this one corrected, but so far not successful in doing it icon_cry.gif

Let me know if any more information is required.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8651
Location: Dubuque, Iowa, USA

PostPosted: Fri Apr 02, 2010 7:09 am
Reply with quote

The file status 35 means (from the manual):
Quote:
An OPEN statement with the INPUT, I-O,
or EXTEND phrase was attempted on a
non-optional file that was not present.
So you need to post the JCL for the step -- specifically the DD names for the VSAM file and the alternate indexes so we can review them.

And you are aware, I hope, that if your program references an alternate index the JCL must contain a reference to the path as DDNAME1? A second alternate index requires DDNAME2 and so forth.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Fri Apr 02, 2010 7:29 am
Reply with quote

Also, set up your prog to capture the extra information made available by VSAM, look at the FILE STATUS clause....
Back to top
View user's profile Send private message
baljinders

New User


Joined: 21 Aug 2006
Posts: 72

PostPosted: Fri Apr 02, 2010 7:30 am
Reply with quote

I knew that status code 35 is VSAM open error. that is why i specifically mentioned the the file is present and has records in it.

I don't have mainframe access right now, but JCL is something like this:

Code:
//step10   exec pgm=pgmname
//steplib   dd dsn=package location for the pgm
//input1    dd dsn=vsam file
//output1  dd dsn= flat file,disp=(new,catlg,),
                          DCB=(recfm=fb,lrecl=1500), etc etc



The program does not references the alternate index. It just does simple read from VSAM file and move to flat file. This is just to take the backup of the file. The flat file is a GDG. The alternate key is defined because this new vsam file will be used on other programs for data extraction purpose. So it will options to extract data on both primary and alternate keys. I am not reading the file in my program on any of the key fields. just plain sequential read .

For information, the primary key is (6 0) and alternate key is (1412 1426) where 6 and 1412 are the key lengths and 0 1426 are starting locations.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Apr 02, 2010 7:33 am
Reply with quote

Use CICS Guy's info to get more VSAM information to the problem....
Back to top
View user's profile Send private message
baljinders

New User


Joined: 21 Aug 2006
Posts: 72

PostPosted: Fri Apr 02, 2010 7:35 am
Reply with quote

Hi CICS Guy,

The program has been coded to handle all the VSAM file status code. From 00 to 99. If the status code is 00 or 97 the pgm executes other wise it abends and displays the information in the abend para.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Fri Apr 02, 2010 7:42 am
Reply with quote

baljinders wrote:
The program has been coded to handle all the VSAM file status code. From 00 to 99.
But the beauty of getting the actual AMS return codes is much more full-filling...
Check it out....data-name-8
Back to top
View user's profile Send private message
baljinders

New User


Joined: 21 Aug 2006
Posts: 72

PostPosted: Fri Apr 02, 2010 7:49 am
Reply with quote

Ok.... I'll check on this tomorrow and get back to you.

On the whole , i am pretty sure it has something to do with the way i am defining the alternate indexs. because the same file opens just file when i comment out the alternate record key clause from the program and drop the AIX and path from the cluster.

Rest will let you know by tomorrow.

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8651
Location: Dubuque, Iowa, USA

PostPosted: Fri Apr 02, 2010 7:56 am
Reply with quote

Quote:
The program does not references the alternate index
This statement is wrong. From your original post where you reference the alternate index:
Code:
SELECT VSAM-File ASSIGN TO DDNAME
ORGANIZATION IS INDEXED
ACCESS MODE IS SEQUENTIAL
RECORD KEY IS PKEY
ALTERNATE RECORD KEY IS
AKEY
WITH DUPLICATES
FILE STATUS IS VSAM-STATUS.
You do not have to use the alternate index in the PROCEDURE DIVISION. You do not have to even have any code that uses AKEY. The mere fact that you specify the alternate index in the SELECT means you have referenced it and must have DDNAME1 in the JCL. Further proof of this is your statement
Quote:
Another thing to notice here is that if the remove the alternate index clause, the program works properly
because when you remove the reference to the alternate index, the JCL works. Therefore the only possible conclusion is that you do not have the alternate index DD name correctly specified in your JCL -- no matter how many times you protest the JCL is correct. Specifically, you must have:
Code:
//input1    dd dsn=vsam file
//input11 dd dsn=vsam.aix.path,disp=shr


Your problem has nothing to do with the VSAM file, how it is defined, nor how the alternate index is defined. Your problem is entirely in the mismatch between your program code and the JCL you are attempting to run the program with.
Back to top
View user's profile Send private message
baljinders

New User


Joined: 21 Aug 2006
Posts: 72

PostPosted: Fri Apr 02, 2010 8:03 am
Reply with quote

Robert,

I did not code any ddname statement for the alternate index in my JCL. I didn't know that it was also required. Thanks for this information. I'll try this tomorrow and get back to you with the result.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8651
Location: Dubuque, Iowa, USA

PostPosted: Fri Apr 02, 2010 8:04 am
Reply with quote

Yes -- the DD name for the alternate index is not optional. If you reference the alternate index in the SELECT statement, you must have a DD name for the path.
Back to top
View user's profile Send private message
baljinders

New User


Joined: 21 Aug 2006
Posts: 72

PostPosted: Fri Apr 02, 2010 8:14 am
Reply with quote

That means if there are n number of alternate indexes defined on a vsam, i should have n number of seperate ddnames for each of the path.

Also , say if i have to define alternate keys on two fields , how to write the select clause for it.

Code:
field1 pic x(02)    AIX1,AIX2
field2 pic x(10)    AIX2


i.e AIX2 is a combination of field 1 and 2. I create two seperate aix's for them but confused about writing the select clause in the pgm.
this is what i have written,

Alternate record key is field1 with duplicates.

is it correct ??
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 02, 2010 8:53 am
Reply with quote

Hello,

Suggest you consider removing what is not necessary for your process from the code.

Then there will be no need to include "extra" dd statements to satisfy the needs of the unneeded code (whew icon_smile.gif ).
Back to top
View user's profile Send private message
baljinders

New User


Joined: 21 Aug 2006
Posts: 72

PostPosted: Fri Apr 02, 2010 9:13 am
Reply with quote

Hi Dick,

Lets just say the last post was also part of the requirement or need :-).
I have been following this forum for the last few months, i must say there are lot of things i can learn from you. All i need to make sure is i ask the right questions..he he
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 02, 2010 9:32 am
Reply with quote

Hello,

Quote:
All i need to make sure is i ask the right questions..he he
The single most important part of getting help for a problem or an answer to a question is making sure that the people who would help/answer completely/clearly understand the question/problem.

This is not always easy to accomplish. . . icon_wink.gif

So sometimes, there are multiple iterations just getting everyone on the same page.
Back to top
View user's profile Send private message
baljinders

New User


Joined: 21 Aug 2006
Posts: 72

PostPosted: Fri Apr 02, 2010 9:51 am
Reply with quote

I'll make sure i state my problems crystal clear.... now did you happen to understand my previous post regarding writing the select clause or do i need to ask it differently ?

Moreover this was my ever post of this forum, so do give me benefit of doubt for few more posts incase i repeat the mistake of not clearly stating my questions :-)
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 02, 2010 10:00 am
Reply with quote

Hello,

As i mentioned before, suggest you remove anything that is not needed. . .

To read the file sequentially, there is no need to have anything about the altrenate indexes in the code. For whatever reason, you may believe you need to mention these, but (unless there is still something i do not yet understand) there should be no reason to mention these in the code or the jcl.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Apr 02, 2010 10:01 am
Reply with quote

baljinders wrote:
All i need to make sure is i ask the right questions..he he
Trust me, Been There, Done That, Got The Tee Shirt and even the tee shirt did not help my pride that much....grin...
Approaching the unapproachable, the more information you can bring with to the better you are equipped to fend off their scorn.
As a somewhat assembler programmer, I know that the actual AMS codes provide so much more information than the single byte of the COBOL file status...
Trust me, information is power and while 'they' might not know it, you can teach them something- but then again, they could point out something dumb that you did (BTDTGTTD)...grin...
Approach 'them' with all the information you can gather and be prepared to, either way, find your fault or get an education,
Back to top
View user's profile Send private message
baljinders

New User


Joined: 21 Aug 2006
Posts: 72

PostPosted: Fri Apr 02, 2010 10:31 am
Reply with quote

The vsam file does require a alternate index because this file will contain data that will be used by other programs. So they can extract data by reading this file based on either primary key or alternate key (as required). Currently this file does not exist in prod but will exist once i am done with the my program for creating it.

It was all working fine untill the business came up with the new requirement of having alternate indexs on some fields. That is when i started to get the error i mentioned in the first post.

I hope , i am clear this time.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 02, 2010 7:24 pm
Reply with quote

Hello,

Quote:
The vsam file does require a alternate index because this file will contain data that will be used by other programs
This is exactly why there are difficulties getting what you want. You are completely mis-focused. . .

The vsam file may need everything defined for various reasons/processes. This particular program does not. . . There is no reason to mention the alternate index. Why do you believe you must have this in your code? Simply run the program as suggested with only the single dd statement and when it works your issue is resolved. . .
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8651
Location: Dubuque, Iowa, USA

PostPosted: Fri Apr 02, 2010 9:10 pm
Reply with quote

Was the alternate index defined with UPGRADE? If so, the alternate index is updated whenever the base cluster is updated -- whether or not the alternate index is specified in your program. The only reason to include an alternate index in your code is because you need to access the VSAM file by the alternate index. If you are not using the alternate index key to look up records, do not put ALTERNATE INDEX in the SELECT statement.
Back to top
View user's profile Send private message
baljinders

New User


Joined: 21 Aug 2006
Posts: 72

PostPosted: Fri Apr 02, 2010 11:18 pm
Reply with quote

This is what i have tried.

1. I used the alternate record key clause in the program and inculded path enteries in my jcl for both the alternate indexs. here aix was defined with noupgrade

2. I removed the alternate record key from the program and the path entries from the jcl. here aix define with upgrade

3. I removed the alternate record key from the program and kept the path entries in the jcl. here aix define with upgrade

Still got this error:

Code:
CEE3250C The system or user abend U1000 R=00000000 was issued.                 
         From compile unit VIKBP01 at entry point VIKBP01 at compile unit offse
         at address 000089D0.                                                 
<> LEAID ENTERED (LEVEL 04/01/2008 AT 12.32)                                   
<> LEAID PROCESSING COMPLETE. RC=0   



The JCL and Cobol part is :

Code:
/BP10SSA DD  DSN=ab23105.bp10.excel.trace,DISP=SHR           
/BP10SSA1  DD  DSN=ab23105.bp10.excel.trace.PATH1,DISP=SHR   
/BP10SSA2  DD  DSN=ab23105.bp10.excel.trace.PATH2,DISP=SHR   
/*                                                             
/BP10SSB  DD  DSN=ab23105.bp10.excel.trace.BKP(+1),           
/             DISP=(,CATLG,DELETE),                             
/             DCB=(RECFM=FB,LRECL=1535,DSORG=PS)     



The program assign clause is :

Code:
SELECT  VSAM-FILE      ASSIGN TO BP10SSA         
                                       ORGANIZATION IS INDEXED   
                                       ACCESS MODE  IS SEQUENTIAL
                                       RECORD KEY IS VS-PKEY
 *                                     ALTERNATE RECORD KEY IS   
 *                                               VS-SYSTEM
 *                                               WITH DUPLICATES 
                                       FILE STATUS  IS VSAM-STATUS.


I had commented out and commented in the assign clause to check the first three entries.

The base cluster has the following description:
Code:
    RECSZ(1535 1535)     
    KEYS(6 0)           
    SPEED               
    NOREUSE             
    SHR(2 3)             
    FSPC(10 10)         
    NOIMBED             
    NOREPLICATE         


and AIX has the following

Code:
NOIMBED           
SPEED             
NONUNIQUEKEY       
UPGRADE           
VOL(* * * * *)-   
KEYS(8  1313)     
RECSZ(609 609)     
SHR(2,3))         
Back to top
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Fri Apr 02, 2010 11:32 pm
Reply with quote

If you are still getting the 35, you must address that first:
Enterprise COBOL for z/OS V4.2 Language Reference wrote:
An OPEN statement with the INPUT, I-O, or EXTEND phrase was attempted on a nonoptional file that was unavailable.

By the way, you should really add data-name-8 as described in FILE STATUS clause.
Enterprise COBOL for z/OS V4.2 Language Reference wrote:
Code:
   | >__ ________________________________________________________ __.______________________________>< |
   |    |_ ______ __STATUS__ ____ __data-name-1__ _____________ _|                                    |
   |      |_FILE_|          |_IS_|               |_data-name-8_|                                      |
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Apr 03, 2010 12:03 am
Reply with quote

Hello,

Quote:
This is what i have tried.

If you want this to run anytime soon, you need to stop flailing away and run the program as has been suggested - multiple times.

This should be all that you need:
Code:
    SELECT  VSAM-SEQ            ASSIGN  VSAMSEQ     
                                RECORD KEY VSAM-KEY   
                                ORGANIZATION INDEXED 
                                ACCESS SEQUENTIAL     
                                STATUS VSAM-CHK.       

Code:
//VSAMSEQ    DD DSN=Some.Dataset.Name,DISP=SHR


Make these exact changes and post back with the result of that run.
Back to top
View user's profile Send private message
baljinders

New User


Joined: 21 Aug 2006
Posts: 72

PostPosted: Sat Apr 03, 2010 12:24 am
Reply with quote

Please ignore my previous post...

My Apolozies...

The Code is working fine now. I was running the program from two jcls. 1 my personal JCL tht i created for test purpose and second JCL which uses proc. the DDname that i included in the above post was from my test jcl and they were similar to the one mentioned in the pgm. so the pgm was runing fine. But when i was running the job from the other JCL, it was getting 35, because the ddnames that were used were BP02SSA and the pgm had BP01SSA.

I made them in sync and the program ran fine.

I wasted lot of time today because of this silly mistake. By since now it is working , i am happy.

Thanks everyone for their help. You guys are really awesome. I really appreciate your effort.

Now, the my pgm is working fine, even if i don't include the path entires in the jcl as i have excluded the alternate record clause from the pgm, does that mean , even if we define aix on vsam and if aix is not used in the pgm, then path entries need not be included in the JCL.

or it is a good practice to inculde them anyways.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Change history of vsam file. JCL & VSAM 3
No new posts WER999A - UNSUCCESSFUL SORT 8ED U Ab... SYNCSORT 5
No new posts DASD - non SMS - volser change - VSAM... JCL & VSAM 2
No new posts the system or user abend SF0F R=NULL COBOL Programming 0
No new posts dsnrexx fails without error message CLIST & REXX 9
Search our Forums:

Back to Top