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
 

 

How to Initialize the VSAM file using JCL

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

Active User


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

PostPosted: Fri Apr 25, 2008 11:40 am    Post subject: How to Initialize the VSAM file using JCL
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: 2180
Location: @my desk

PostPosted: Fri Apr 25, 2008 12:32 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri Apr 25, 2008 12:36 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Fri Apr 25, 2008 12:36 pm    Post subject: Reply to: How to Initialize the VSAM file using JCL
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    Post subject:
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    Post subject:
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: 205
Location: Bangalore

PostPosted: Fri Apr 25, 2008 8:27 pm    Post subject: Reply to: How to Initialize the VSAM file using JCL
Reply with quote

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

CICS Moderator


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

PostPosted: Fri Apr 25, 2008 9:19 pm    Post subject: How to Initialize the VSAM file using JCL
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    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 Fail to change physical VSAM filename... jacobdng CICS 6 Fri Jan 20, 2017 12:36 pm
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts Underlying DB2 VSAM LDS - SMF recording vasanthz All Other Mainframe Topics 6 Thu Jan 05, 2017 4:20 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm


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