Page 1 of 1

How to create a member and write into it.

PostPosted: Thu Apr 03, 2014 9:16 pm
by samurai
Can someone help me in the below requirement.

Need to read from PS mmm.work.jcl

it has 3 program name
xxx
yyy
zzz

For each program we need to create a member and write a bind card alone as

BIND PACKAGE(TJ8) -
QUALIFIER(TJ8) -
OWNER(TJ8) -
MEMBER(M3MEFA00) -
ACTION(REPLACE) -
VALIDATE(BIND) -
ISOLATION(UR) -
CURRENTDATA(NO) -
RELEASE(COMMIT) -
DEGREE(ANY) -
EXPLAIN(NO)


in this bind card need to cahnge M3MEF to xxxxx


Help !!

Re: How to create a member and write into it.

PostPosted: Thu Apr 03, 2014 9:33 pm
by NicC
What is wrong with doing it by hand? It would have been done and dusted a long time ago. It is not as though there are laods of members to create. There are various ways to do it - have your bind cards in a stem within your program, use file tailoring, create an edit macro to edit and save the bind cards. all can be done with a little reading and no 'rocket science' rexx.

Re: How to create a member and write into it.

PostPosted: Thu Apr 03, 2014 10:56 pm
by Ed Goodman
I have something that works great in batch:
WRITE_MEMBER:                                             
ARG MEM_NAME                                               
DNAME = "WTSO.WNEG.DBA.DBDTEXT("||MEM_NAME||")"     
"ALLOC DA('"DNAME"') F(STATOUT) SHR"                       
  QUEUE ''                                                 
  "EXECIO * DISKW STATOUT (FINIS"                         
"FREE  F(STATOUT)"                                         
RETURN                                                     


I just build my lines and queue them, then call this procedure. The empty QUEUE statement lets the EXECIO do a clean write.

I run this from TSO, never tried it in batch. Of course the PDS has to be defined already.

Re: How to create a member and write into it.

PostPosted: Sat Apr 05, 2014 1:06 pm
by samurai
Thanks Nic & Godman,

I have tried with Reading the file1 and hardcoded the bind card as

icd.1 = " BIND PACKAGE(TJ8) - "
icd.2
...
...
used substr to select the program name without version as

var = substr(inp.i,1,5)

and wrote in output file as "mmm.output.jcl "(" || ' " var " ' || ")" ....icd.

which writes into the output pds with mem name exist without version name and bind card in it/

Thanks

Re: How to create a member and write into it.

PostPosted: Sat Apr 05, 2014 5:26 pm
by Ed Goodman
Ed Goodman wrote:I have something that works great in batch:...

...I run this from TSO, never tried it in batch...



Wow...must have been typing too fast that day. I do run it only in TSO, never in batch. I think I would leave out the DD statement if I ran it in batch though, since the ALLOC statement takes care of it dynamically.