How to create a member and write into it.



IBM's Command List programming language & Restructured Extended Executor

How to create a member and write into it.

Postby samurai » Thu Apr 03, 2014 9:16 pm

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 !!
samurai
 
Posts: 30
Joined: Tue Mar 18, 2014 3:29 pm
Has thanked: 6 times
Been thanked: 0 time

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

 

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

Postby NicC » Thu Apr 03, 2014 9:33 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

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

Postby Ed Goodman » Thu Apr 03, 2014 10:56 pm

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.
Ed Goodman
 
Posts: 342
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

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

Postby samurai » Sat Apr 05, 2014 1:06 pm

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
samurai
 
Posts: 30
Joined: Tue Mar 18, 2014 3:29 pm
Has thanked: 6 times
Been thanked: 0 time

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

Postby Ed Goodman » Sat Apr 05, 2014 5:26 pm

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.

These users thanked the author Ed Goodman for the post:
samurai (Mon Apr 07, 2014 6:09 pm)
Ed Goodman
 
Posts: 342
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post