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

Vsam Initialization


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

New User


Joined: 05 Nov 2007
Posts: 11
Location: hyderabad

PostPosted: Thu May 28, 2009 1:57 pm
Reply with quote

Hi,

I have a VSAM file which I am first deleting and defining, down the line will process a program which may insert few records to it.
In another jOb I am Reproing this VSAM file to a Flat file. If no records were inserted to the VSAM file it is giving me an error saying :
ERROR OPENING WE8D.T546D.CLPREREN
** VSAM OPEN RETURN CODE IS 160

I tried to initialize the File through JCl by including a step before repro to copy a dummy record to it. But still it is giving me the same error.

//WESW020 EXEC PGM=IDCAMS ==> INITIALIZE CLPREREN
//DUMMYIN DD DUMMY,DISP=SHR,
// DCB=(SYS.MODEL,LRECL=01200,RECFM=FB)
//SYSIN DD DSN=TSZV055.COB.COB(REPRO),
// DISP=SHR
----+----1----+----2----+----3----+----4----+----5--
REPRO INFILE(DUMMYIN) -
OUTFILE(OUTFIL1)
//OUTFIL1 DD DSN=WEST.WSZVD.TO16D.CLPREREN,
// DISP=SHR
//SYSPRINT DD SYSOUT=(*)
//SYSUDUMP DD SYSOUT=(D),
// HOLD=YES

Please let me know if there is any other way to Initialize the VSAM file through JCL.
I can't use VSAMINIT.

Thanks,
Smita
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu May 28, 2009 2:09 pm
Reply with quote

But you do not actually write a record to the file do you. The input is dummied out.
Back to top
View user's profile Send private message
smita V

New User


Joined: 05 Nov 2007
Posts: 11
Location: hyderabad

PostPosted: Thu May 28, 2009 2:14 pm
Reply with quote

I was trying out a way to initialize the VSAM dataset, as I have read it in other posts. If it had worked, I could have used it after confirming that the VSAM file is empty.
But if there is any other better way, please let me know.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu May 28, 2009 5:02 pm
Reply with quote

Quote:
I was trying out a way to initialize the VSAM dataset, as I have read it in other posts. If it had worked, I could have used it after confirming that the VSAM file is empty.
Your statements here are in conflict. To initialize the VSAM file, you must write a record into it. An initialized VSAM file therefore cannot be empty. You can then delete that record so the file has no records in it.

"Empty" as used in the VSAM Demystified IBM Redbook, and in this post, means something entirely different from the file not having any records in it. The Redbook states
Quote:
You need to load a data set first, because in VSAM non-RLS mode, your application program cannot open for input to an empty data set.


And, unlike flat files, VSAM files must actually have something written to them -- using a REPRO from a DUMMY input file does not do anything to the VSAM file, so it remains empty.
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

 


Similar Topics
Topic Forum Replies
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts CVDA value for RRDS VSAM dataset. CICS 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Open VSAM File in IMS DC Region - DFS... IMS DB/DC 0
Search our Forums:

Back to Top