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

Read the member from file,use that in Bind JCL and submit


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Aham

New User


Joined: 24 Oct 2007
Posts: 42
Location: chennai

PostPosted: Thu Dec 27, 2007 9:22 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Dec 27, 2007 9:33 pm
Reply with quote

I don't see anything so far in your description that would indicate that you can't.
Back to top
View user's profile Send private message
Ganesh.Deokar

New User


Joined: 30 Sep 2005
Posts: 26
Location: Buffalo,NY

PostPosted: Fri Dec 28, 2007 12:58 am
Reply with quote

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
View user's profile Send private message
Aham

New User


Joined: 24 Oct 2007
Posts: 42
Location: chennai

PostPosted: Fri Dec 28, 2007 1:28 pm
Reply with quote

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
View user's profile Send private message
Aham

New User


Joined: 24 Oct 2007
Posts: 42
Location: chennai

PostPosted: Fri Dec 28, 2007 8:13 pm
Reply with quote

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
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Fri Dec 28, 2007 8:57 pm
Reply with quote

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
View user's profile Send private message
Aham

New User


Joined: 24 Oct 2007
Posts: 42
Location: chennai

PostPosted: Fri Dec 28, 2007 10:11 pm
Reply with quote

Thank you Douglas
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top