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
 

 

VSAM OPEN RETURN CODE IS 160

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
queryman

New User


Joined: 28 Nov 2011
Posts: 3
Location: India

PostPosted: Fri Feb 24, 2012 7:04 pm    Post subject: VSAM OPEN RETURN CODE IS 160
Reply with quote

Hi,

I am getting the error "IDC3351I ** VSAM OPEN RETURN CODE IS 160" in one of the step of my job to take the bake up of the input VSAM file.As error code showed, my input file is empty and so the error is coming.

But since last 3 runs the input file were empty and it did not abend.I checked the history of the job and found that sometimes the input file was empty and job went fine and some time it abended with the RETURN CODE 160.

Can anybody please help me in understanding the behavior of the code 160?

Thanks and regards,
Pallabi
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Fri Feb 24, 2012 7:13 pm    Post subject: Reply to: VSAM OPEN RETURN CODE IS 160
Reply with quote

If you are going to bake the input file, take the dog out of the oven first :-)

You'll have to do some digging into your job logs. Is the file delete/defined somewhere in the run? How does it become "empty"? Have you looked up the message with the 160, and what did you understand by it? Have you googled for suspects and information?
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: Fri Feb 24, 2012 7:44 pm    Post subject:
Reply with quote

What are you using to perform the backup
What are the full messages and codes issued.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Feb 25, 2012 2:12 am    Post subject:
Reply with quote

Quote:
But since last 3 runs the input file were empty and it did not abend.I checked the history of the job and found that sometimes the input file was empty and job went fine and some time it abended with the RETURN CODE 160.


/sarcasm on/

Oh yeah, computers are like that: one time doing one thing and the next, doing something else.

/sarcasm off/
Back to top
View user's profile Send private message
queryman

New User


Joined: 28 Nov 2011
Posts: 3
Location: India

PostPosted: Sat Feb 25, 2012 7:51 am    Post subject: Reply to: VSAM OPEN RETURN CODE IS 160
Reply with quote

Hi,

I have used the IDCAMS utility to take the back up of the file.The job step is:

//STEP2 EXEC PGM=IDCAMS
//DD1 DD DSN=INPUT.DATASET,DISP=SHR,
// AMP=(‘BUFNI=04,BUFND=12’)
//DD2 DD DSN=BACKUP.DATASET(+1),DISP=(.CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(25,10)),
// DCB=(RECFM=FB,LRECL=40,BLKSIZE=0,BUFNO=15)
//SYSIN DD DSN=PARMLIB.DATASET(COPYMEM),DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//*

The error message shows as:
.IDCAMS SYSTEM SERVICES
.
.REPRO INFILE(DD1)-
. OUTFILE(DD2)
.IDC3300I ERROR OPENING INPUT.DATASET
.IDC3351I **VSAM OPEN RETURN CODE IS 160
.IDC0005I NUMBER OF RECORDS PROCESSED WAS 0
.IDC3003I FUNCTION TERMINATED.CONDITION CODE IS 12
.
IDC0002I IDCAMS PROCESING COMPLETE.MAXIMUM CONDITION CODE WAS 12

But the same step did not abend in other run while input file was with 0 records.The SYSPRINT message is:

.IDCAMS SYSTEM SERVICES
.
.REPRO INFILE(DD1)-
. OUTFILE(DD2)
.IDC0005I NUMBER OF RECORDS PROCESSED WAS 0
.IDC0001I FUNCTION COMPLETED.HIGHEST CONDITION CODE WAS 0
.
IDC0002I IDCAMS PROCESING COMPLETE.MAXIMUM CONDITION CODE WAS 0

PS:The input file got created in differnt job where some times no records to put.

Thanks and regards,
Pallabi
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Sat Feb 25, 2012 10:23 am    Post subject:
Reply with quote

VSAM distinguishes between an empty file and a file with no records in it. An empty file is a file that has been created but has never been opened for output and had records placed in it. Once a VSAM file is opened and at least one record placed in it, the file is no longer empty -- even if the record is then immediately deleted.

The 160 means, most likely (any other reason could indicate serious problems with your system that your support group probably would be addressing already), that the VSAM file you are attempting to open for input is empty. VSAM does not allow an empty file to be opened for input or I-O processing, period.

So the answer to your problem is to make sure that the input VSAM file has had at least one record written to it, even if that record is then deleted. If you wish to claim that another job did not get the IDC3351I message with return code 160, that is entirely possible -- because the input VSAM file was not empty at the time that job executed. This does NOT change the fact that your job execution failed for an empty VSAM file.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Feb 25, 2012 10:30 am    Post subject:
Reply with quote

then your problem is not empty file, but un-initilized file.

all of your delete/defines should be followed by an initialization.
write a record, delete the record.

then process with your program.

but, do you really want to be backing-up empty files?

if so, add the initialization process to all of your delete/defines
then you will get clean backups of empty files.

but if you do not want to back-up empty files,
precede the repro step with a PRINT(1)
and if that bombs, then skip the repro step.

depends on what you want to do,

but, i imagine the 160 is coming based on the initialization (lack of).

and as usual, i am slow, Robert was here first, but i am here last icon_lol.gif
Back to top
View user's profile Send private message
queryman

New User


Joined: 28 Nov 2011
Posts: 3
Location: India

PostPosted: Sat Feb 25, 2012 11:37 am    Post subject: Reply to: VSAM OPEN RETURN CODE IS 160
Reply with quote

Thanks All !!!
I understood the problem with code 160.For the time I will include the initialisation of the input dataset to rectify the abend.
For taking the back up of empty input file, I will analyse a bit more whether back up is needed or not for every run, regardless of file has record or not.

Thanks and Regards,
Pallabi
Back to top
View user's profile Send private message
Pete Wilson

Active User


Joined: 31 Dec 2009
Posts: 437
Location: London

PostPosted: Mon Mar 19, 2012 9:36 pm    Post subject:
Reply with quote

google VSAMINIT for an initialisation job
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 -> JCL & VSAM 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 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 IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts DFHWS2LS return value divated CICS 4 Mon Nov 07, 2016 5:44 pm
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am


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