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

How to Initialize the VSAM file using JCL


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

Active User


Joined: 06 Sep 2007
Posts: 275
Location: Bang,iflex

PostPosted: Fri Apr 25, 2008 11:40 am
Reply with quote

Hi,

there is a cobol program which writes and re-writes the VSAM dataset, the content of VSAM data set is used to generate a REPORT.

The VSAM data set is an empty dataset before the data written to it, the file opened in I/O mode because VSAM processing involves both write and rewrite.

To do this process we have a JCL which DELETES the cluster and CREATES the cluster every time the JCL is sbmitted, but still when we check the VSAM dataset was not intialised.

We did write another small program and opened the VSAM in OUTPUT mode and closed the VSAM, we keep this program execution in one STEP of JCL before the actual progam, But still the VSAM data set is not intialised.

Is there is any way, so that we can intialise the empty VSAM dataset thru JCL

Thanks in Advance.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Apr 25, 2008 12:32 pm
Reply with quote

Vasanth,

What do you mean by both write and rewrite.? If you want to reuse the cluster define it with REUSE option instead of deleting it and creating it again.

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

Global Moderator


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

PostPosted: Fri Apr 25, 2008 12:36 pm
Reply with quote

To initialise the VSAM cluster, you usually write a record to it.

It is common practice, and common sense if you ask me, that every VSAM KSDS has a low and high values record inserted as default.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Apr 25, 2008 12:36 pm
Reply with quote

to have a vsam dataset initialized open and close is not enough...
search the net for something like "VSAM INITIALIZATION" You will find many useful hits

www.cbttape.org file183 for example
Back to top
View user's profile Send private message
mymains
Currently Banned

New User


Joined: 24 Apr 2008
Posts: 5
Location: Banglore

PostPosted: Fri Apr 25, 2008 3:03 pm
Reply with quote

Hi Vasanth,
i think by using a GDG we can easily solve this problem being u creating a report it is quite useful compared to use simple vsam files\
thnkz
Mymains
Back to top
View user's profile Send private message
jaspal

New User


Joined: 22 May 2007
Posts: 68
Location: mumbai

PostPosted: Fri Apr 25, 2008 8:08 pm
Reply with quote

Hi,

1). To initialize the VSAM ,you can open it once in output mode and close it in program during initializaton, it could solve your problem.
after that again open it in I/o mode.

2) write a step in jcl whic delete defines VSAM and REPRO some records from a flat file Say GDG version.
this step should be executed before program uses VSAm.

Regards,
Jaspal @ 9833814470
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Fri Apr 25, 2008 8:27 pm
Reply with quote

Refer to the below link:
ibmmainframes.com/about6008.html
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Apr 25, 2008 9:19 pm
Reply with quote

If you have DITTO, you can initialize a newly created record with low-values, via -

Code:

$$DITTO  BVS   FILEOUT=XXXXXXXX,NLRECS=1,RECSIZE=nnnnn,FILLCHAR=X'00'     

HTH....

Regards,

Bill
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 FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top