View previous topic :: View next topic
|
Author |
Message |
Aham
New User
Joined: 24 Oct 2007 Posts: 42 Location: chennai
|
|
|
|
I have a dataset FB 80 which has the COBOL members that need to binded to a DB2 region. I have a bind JCL where I have to change the member name alone and submit. I have to do this for a long list of programs. Is there a way I can do it using REXX ? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I don't see anything so far in your description that would indicate that you can't. |
|
Back to top |
|
|
Ganesh.Deokar
New User
Joined: 30 Sep 2005 Posts: 26 Location: Buffalo,NY
|
|
|
|
1) Create a list of all the members(programs) you want to bind and store them in a PS file or PDS member.
2) Write a small REXX program to read this file and write the member name into bind syntax. You can write multiple bind statements in a single step.
The code will be like this:
Code: |
/*REXX*/
address tso
"alloc da('XXXX.XXX.bindjcl') fi(jcl) shr reuse"
"execio * diskr jcl (stem write. finis"
write.1 ='//'jclname' JOB PRTY=03,'
write.2 ='// REGION=8M,'
write.3 ='// MSGCLASS=M,'
write.4 ='// MSGLEVEL=(1,1)'
write.5 ='//*'
write.6 ='//BINDPACK EXEC PGM=IKJEFT01,DYNAMNBR=20'
write.7 ='//DBRMLIB DD DISP=SHR,DSN=your.dbrmlib'
write.8 ='//SYSTSPRT DD SYSOUT=*'
write.9 ='//SYSTSIN DD *'
w = 9
"alloc da('XXXXXX.XXXX.member.list') fi(input) shr reuse"
"execio * diskr input (stem read. finis"
do i = 1 to read.0 by 1
member = word(read.i,1)
w = w + 1
write.w = ' DSN SYSTEM(DSN)'
w = w + 1
write.w = ' BIND PACKAGE(name) MEMBER('member') ISOLATION(CS) -'
w = w + 1
write.w = ' VALIDATE(BIND) RELEASE(COMMIT) CURRENTDATA(NO) -'
w = w + 1
write.w = ' DEGREE(ANY) EXPLAIN(NO)'
end
"execio * diskw jcl (stem write. finis" |
|
|
Back to top |
|
|
Aham
New User
Joined: 24 Oct 2007 Posts: 42 Location: chennai
|
|
|
|
Hi Ganesh.Deokar! I am extremely grateful to you! I checked this and it works fine. Though this is simple coding I am pretty new to rexx and I do not know much abouot this
Quote: |
You can write multiple bind statements in a single step.
|
I do not know this earlier . Thanks for the info |
|
Back to top |
|
|
Aham
New User
Joined: 24 Oct 2007 Posts: 42 Location: chennai
|
|
|
|
Code: |
say 'Enter the Library name to place the bind'
pull bindjcl
"alloc da('bindjcl') fi(jcl) shr reuse" |
If at all I want to accept the bind jcl name from the user Can I code something like above? Because I am getting RC 0 but JCL is not built. If the JCL name is hardcoded everything looks fine. Please advice. |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
I tried it with "trace all" and found that it was allocating a dataset called BINDJCL.
The following seems to work.
Code: |
/* REXX TEST */
TRACE ALL
SAY 'ENTER THE LIBRARY NAME TO PLACE THE BIND'
PULL BINDJCL
"ALLOC DA('"||BINDJCL||"') FI(JCL) SHR REUSE" |
|
|
Back to top |
|
|
Aham
New User
Joined: 24 Oct 2007 Posts: 42 Location: chennai
|
|
|
|
Thank you Douglas |
|
Back to top |
|
|
|