|
|
| Author |
Message |
cvadlamudi
Active User
Joined: 19 Apr 2007 Posts: 56 Location: India
|
|
|
|
Hi,
Is there any utility to initialize the VSAM file, before using in program.
Thanks & Regards,
Chandramouli.V |
|
| Back to top |
|
 |
References
|
|
 |
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 3509 Location: Brussels once more ...
|
|
|
|
| Why not repro in one record with high values in the key field. |
|
| Back to top |
|
 |
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 185 Location: Chennai
|
|
|
|
I guess it is a shop specific utilty VSAMINIT.It may/maynot be available at your firm.
If available,the way to code it is
| Code: |
//R020 EXEC PGM=VSAMINIT,PARM='LOW',COND=(0,LT)
//INIT01 DD DSN=<VSAM File Name>,
// DISP=SHR
//SYSOUT DD SYSOUT=* |
|
|
| Back to top |
|
 |
revel
Active User
Joined: 05 Apr 2005 Posts: 132 Location: Bangalore/Chennai-INDIA
|
|
|
|
In case, there is no VSAMINIT utility in your shop...Try this..
Write a simple program whcih will open VSAM DATASET(One which u need to initialize) in OUTPUT MODE then Close it.
Just Run this program, VSAM will get initialized.... |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 8644 Location: 221 B Baker St
|
|
|
|
Hello,
If you use this approach, i'd recommend writing one record of all high-values into the file before closing it.
Many processes have problems with completely empty vsam files. |
|
| Back to top |
|
 |
revel
Active User
Joined: 05 Apr 2005 Posts: 132 Location: Bangalore/Chennai-INDIA
|
|
|
|
Dick,
| Quote: |
| If you use this approach, i'd recommend writing one record of all high-values into the file before closing it. |
Initialization means; not writing dummy record or 1 record with high values to an existing empty file..
Just for clarification,
consider a scenario; after inserting 1 record with high values to an empty dataset and you are processed that Dataset, now we are having couple of record for which we need to generate REPORT..
Since we are having 1 record with High values in vsam dataset, we need to have logic to bypass the record which is having high values, its quite cubersome process..
so, instead of doing so... we can open that Empty dataset in OPEN Mode and Close it.. It will initialize VSAM dataset for you..
Even you cross verify by 3.4 option beyond that VSAM dataset
by coding
Print ID(/) Char then ENTER
on executing above command u will get return code as Zero, it measn that The Dataset get initialized.. |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 8644 Location: 221 B Baker St
|
|
|
|
Hello,
| Quote: |
| Since we are having 1 record with High values in vsam dataset, we need to have logic to bypass the record which is having high values, its quite cubersome process.. |
Yes, the high-values records would need to be handled, but if this done automatically for all vsam in that particular system, it is not cumbersome - it is in place from the beginning and every program would have the small extra bit to ignore the high-values record.
I don't say this is a requirement, just that many systems are built this way to prevent ugly surprises when some new process stumbles on the "empty" file.
More important is that any files/programs be built according to the standards of the organization. Regardless of the approach, it is best if all of the development follow the standards. |
|
| Back to top |
|
 |
|
|