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

Creating Multiple GDG base


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

New User


Joined: 10 Aug 2007
Posts: 9
Location: Pune

PostPosted: Sun Aug 12, 2007 7:53 am
Reply with quote

//PROCNAME PROC
//GDGCRE01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
//DEFINE GDG (NAME(&ACTCDE.IDS.&MABRV.M0307.IDCM) SCRATCH LIMIT(3)) //
//
// PEND

Hi
Suppose I have described a PROC as above to create GDG base. Now in case of &ACTCDE and &MABRV, I want to have different values which I would be describing in PS (MYFILE.ACTCDE) as below:- (LET US SUPPOSE THERE ARE ONLY 2 ENTRIES IN THE PS)

BHP NL
POR P

Now how to call these values in the step name to create BHP.IDS.NL.M0307.IDCM and POR.IDS.P.M0307.IDCM?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Aug 12, 2007 8:11 am
Reply with quote

Hello Neeraj and welcome to the forums,

This
Quote:
//DEFINE GDG (NAME(&ACTCDE.IDS.&MABRV.M0307.IDCM) SCRATCH LIMIT(3)) //
//
is invalid.

If it is "input" data (i.e. a control statement), input is not permitted inside a PROC. If it is some sort of JCL, it is not a valid JCL statement. If it is "data" the symbolic parameter may not be used to determine the value at runtime.

You will need to think of another approach.
Back to top
View user's profile Send private message
Kumar Neeraj

New User


Joined: 10 Aug 2007
Posts: 9
Location: Pune

PostPosted: Sun Aug 12, 2007 8:30 am
Reply with quote

Thanks!!!

Like my requirement is to create a generic job that would create multiple GDG base....Now the naming convention of the GDG depends upon these 2 parameters...so I thought of putting them into a file and calling them in the job.
Can you advice me any approach to this?
Can REXX be used?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Aug 12, 2007 8:37 am
Reply with quote

You're welcome icon_smile.gif

You could use rexx or cobol or other methods as well.

You would read your parameters and "fill in" the nodes of the dataset names, creating the DEFINE statements in a sequential dataset.

Once your process builds the control statements, an IDCAMS step could read them and actually create the gdg base entries you want to create.
Back to top
View user's profile Send private message
Kumar Neeraj

New User


Joined: 10 Aug 2007
Posts: 9
Location: Pune

PostPosted: Mon Aug 13, 2007 12:57 am
Reply with quote

Thanks a lot icon_smile.gif

I would definately let u know once that has been done
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 13, 2007 2:03 am
Reply with quote

Good luck icon_smile.gif

We're here if there are questions.
Back to top
View user's profile Send private message
Kumar Neeraj

New User


Joined: 10 Aug 2007
Posts: 9
Location: Pune

PostPosted: Fri Aug 17, 2007 3:11 am
Reply with quote

Hi Dick,

Since I dont have much knowledge in REXX I decided to do it through this JCL itself.

Can you explain me what is the problem if I describe a symbolic variable in the DD name in the PROC and then call some values from a PS to generate the required GDG name?

If it is feasible can you suggest how to call the data from the PS in the job in place of those symbolic variables.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Aug 17, 2007 3:59 am
Reply with quote

Hello Neeraj,

If you post what you want to do (that is different from the original info posted), we can offfer suggestions on how you could proceed.

Please show what you have and what you want for output.

Keep in mind that it may be much easier and more flexible if you write a small COBOL program to do what you need.

I'll try to check back later tonight.
Back to top
View user's profile Send private message
Kumar Neeraj

New User


Joined: 10 Aug 2007
Posts: 9
Location: Pune

PostPosted: Fri Aug 17, 2007 4:20 am
Reply with quote

Hi Dick,

Actually I need to create multiple GDG bases. For example:-

BHP.IDS.NL.M0307.IDCM
POR.IDS.P.M0307.IDCM

Now here [BHP,NL] and [POR,P] are the identifiers which would always be different for different instances.

Now we have been creating a single GDG base for an instance and repeating that job for different cases.

Now I want to run a generic job which would create all the GDG base for all the instances at one go.

I hope this would make you more clear about the problem. Can you suggest some thing regarding this?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Aug 17, 2007 5:33 am
Reply with quote

Kumar Neeraj wrote:
Now here [BHP,NL] and [POR,P] are the identifiers which would always be different for different instances.


Where are these identifiers determined? Are they being read-in from a file? How are they going to be resolved & passed into an IDCAMS DEFINE process? Why would anyone want to do this in batch?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Aug 17, 2007 5:47 am
Reply with quote

Hello Neeraj,

Quote:
Can you suggest some thing regarding this?

Yes.

With the editor, create a file or a member in some 80-byte pds that has one record for each of your sets of identifiers
Code:

bhp     nl
por     p
i used fixed length to make the code easier and you would not have to parse the identifiers in the code (you can always make the code more elegant if you want later - after you've proved the concept). In your FD name the fields INP-1 and INP-2 ('cause that's what i used below).

In the working-storage define these fields:
Code:
     01  build-def.
       05 BD-1 pic x(21) value '  //DEFINE GDG (NAME('.
       05 BD-2 pic x(05) value '.IDS.'.   
       05 BD-3 pic x(30) value '.M0307.IDCM) SCRATCH LIMIT(3)).

     01  DEF-CTRL   pic x(80) value spaces.


In the procedure division, STRING the values together creating a complete DEFINE statement
Code:

     MOVE SPACES TO DEF-CTRL.
     STRING BD-1 DELIMITED BY '~'
            INP-1 DELIMITED BY SPACE
            BD-2 DELIMITED BY '~'
            INP-2 DELIMITED BY SPACE
            BD-3 DELIMITED BY '~'
       INTO  DEF-CTRL.
     WRITE DEF-OUT FROM DEF-CTRL.


Once you have written the DEFINE statements to a new file, use that file as input to IDCASMS to actually define the GDGs. Your job woiuld be 1 bit of work with the editor and a 2-step process to create the DEFINEs and use them in IDCAMS.

Good luck icon_smile.gif
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top