View previous topic :: View next topic
|
Author |
Message |
smita V
New User
Joined: 05 Nov 2007 Posts: 11 Location: hyderabad
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
But you do not actually write a record to the file do you. The input is dummied out. |
|
Back to top |
|
|
smita V
New User
Joined: 05 Nov 2007 Posts: 11 Location: hyderabad
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
|