MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Initialize VSAM file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Sun Nov 12, 2006 5:49 pm    Post subject: Initialize VSAM file Reply with quote

Hi ,

Is there a way I can initilize a KSDS VSAM file in batch mode?

~Mt
Back to top
View user's profile Send private message
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Sun Nov 12, 2006 6:02 pm    Post subject: Reply with quote

am sorry I mispelled my problem. I need to delete/define and initilize the vsam file in a single step.
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Sun Nov 12, 2006 8:35 pm    Post subject: Reply with quote

Martin wrote:
I need to delete/define and initilize the vsam file in a single step.


I'm not sure I understand the issue. That normally WOULD be done in a single step (using IDCAMS), unless you're using some other utility.
Back to top
View user's profile Send private message
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Sun Nov 12, 2006 11:43 pm    Post subject: Reply with quote

Could you please give me the syntax/code... I know how to delete/define...

How do u initialize in the same step ?
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Mon Nov 13, 2006 2:34 am    Post subject: Reply with quote

Martin,

Try this code:
Code:

//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
 DELETE  USER.TEST.VSAM        PURGE CLUSTER                     
 DEFINE CLUSTER ( -                                                     
 NAME(USER.TEST.VSAM)        -                                   
               VOLUME(* *)      -                                       
               UNIQUE -                                                 
               SHAREOPTIONS(3 3) -                                     
               CYLINDERS(7 7)) -                                       
             DATA ( -                                                   
               NAME(USER.TEST.VSAM.DATA)         -               
               KEYS (29 0) -                                           
               RECORDSIZE(35 35) -                                     
               CISZ(4096)) -                                           
             INDEX ( -                                                 
               NAME(USER.TEST.VSAM.INDEX)        -               
               NOIMBED NOREPLICATE)                                     
/*
//STEP020  EXEC PGM=IDCAMS                                             
//IN   DD  DSN=USER.TEST.PS,DISP=SHR                       
//OUT  DD  DSN=USER.TEST.VSAM,DISP=SHR                                 
//SYSOUT   DD  SYSOUT=*                                       
//SYSPRINT DD  SYSOUT=*                                         
//SYSIN    DD  *
  REPRO INFILE(IN) OUTFILE(OUT)
/*
//

_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Mon Nov 13, 2006 6:08 am    Post subject: Reply with quote

shekar123,

Iwant to achieve it one single step. You solution has 2 steps.

~mt
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Mon Nov 13, 2006 10:21 am    Post subject: Reply with quote

Martin,

Try this code:
Code:

//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//IN       DD DSN=USER.TEST.PS,DISP=SHR             
//SYSIN    DD DSN=USER.TEST.CARDS(ABCD),DISP=SHR
//

USER.TEST.CARDS(ABCD)
 DELETE  USER.TEST.VSAM        PURGE CLUSTER                     
 DEFINE CLUSTER ( -                                                     
 NAME(USER.TEST.VSAM)        -                                   
               VOLUME(* *)      -                                       
               UNIQUE -                                                 
               SHAREOPTIONS(3 3) -                                     
               CYLINDERS(7 7)) -                                       
             DATA ( -                                                   
               NAME(USER.TEST.VSAM.DATA)         -               
               KEYS (29 0) -                                           
               RECORDSIZE(35 35) -                                     
               CISZ(4096)) -                                           
             INDEX ( -                                                 
               NAME(USER.TEST.VSAM.INDEX)        -               
               NOIMBED NOREPLICATE))                   
      REPRO -                                                           
             INFILE  ( IN ) -                                       
             OUTDATASET ( USER.TEST.VSAM ) 

_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Mon Nov 13, 2006 11:48 am    Post subject: Reply with quote

One more question here...

What if I IN file is empty ? I tested it out and it doesn't seem to be working.
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Mon Nov 13, 2006 12:45 pm    Post subject: Reply with quote

Martin,

I just showed you the JCL how to code in a single step and make sure that you set up data properly to get repro successful.
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group