View previous topic :: View next topic
|
Author |
Message |
Kumar Neeraj
New User
Joined: 10 Aug 2007 Posts: 9 Location: Pune
|
|
|
|
//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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Kumar Neeraj
New User
Joined: 10 Aug 2007 Posts: 9 Location: Pune
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome
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 |
|
|
Kumar Neeraj
New User
Joined: 10 Aug 2007 Posts: 9 Location: Pune
|
|
|
|
Thanks a lot
I would definately let u know once that has been done |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good luck
We're here if there are questions. |
|
Back to top |
|
|
Kumar Neeraj
New User
Joined: 10 Aug 2007 Posts: 9 Location: Pune
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Kumar Neeraj
New User
Joined: 10 Aug 2007 Posts: 9 Location: Pune
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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
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 |
|
Back to top |
|
|
|