Page 1 of 1

Alias creation by executing REXX.

PostPosted: Mon Oct 25, 2010 1:37 pm
by jaggz
Hi,

For creation of Alias we have a JCL like :

000100 //A255209K JOB MSGCLASS=X,MSGLEVEL=(1,1),CLASS=T,
000200 // REGION=5M,NOTIFY=&SYSUID
000300 //STEP1 EXEC PGM=IDCAMS
000400 //SYSPRINT DD SYSOUT=E
000500 //SYSIN DD *
000700 DEFINE ALIAS(NAME(xxxxxx) RELATE(CATALOG.xxxxx.xxxxxx)) .

Often we get a task for defining an alias in an LPAR. So instead of each time running a JCL is there a REXX program where i can execute by answering to those prompt such as enter alias name :
Relate catalog :


Apology ,I was bit confused to post this question whether to REXX or System securities.

Re: Alias creation by executing REXX.

PostPosted: Mon Oct 25, 2010 1:55 pm
by expat
Yes, but you will need to write it yourself.

Re: Alias creation by executing REXX.

PostPosted: Mon Oct 25, 2010 6:49 pm
by NicC
Whether you run it as a rexx program or as a job you still have to type the two parameters and a job gives you a better audit trail unless you do an elaborate program.

Re: Alias creation by executing REXX.

PostPosted: Mon Oct 25, 2010 9:53 pm
by steve-myers
You can run the IDCAMS commands as TSO command directly in your Rexx exec, though you should enclose the new alias name and the related catalog name in single quotes:

define alias('alias') relate('usercatlog')

There is no need to prepare and run a batch job that invokes IDCAMS!

Re: Alias creation by executing REXX.

PostPosted: Thu Oct 28, 2010 1:26 am
by Pedro
Since this question also mentions LPARs, I suggest that you may want to issue the define commands more than one time:
define alias('alias') relate('usercatlog') catalog('sys1.master.lpar1')
define alias('alias') relate('usercatlog') catalog('sys1.master.lpar2')
define alias('alias') relate('usercatlog') catalog('sys1.master.lpar3')

Without the catalog parameter, it will only catalog it in system where the rexx runs on.

Do not forget to check the return codes.

Re: Alias creation by executing REXX.

PostPosted: Thu Oct 28, 2010 8:24 am
by steve-myers
Pedro's idea is good, but ...

In the 1990s I worked at a multiple LPAR site that did just that. Every once in a while the define alias command for a master catalog on a foreign LPAR failed. Since no one ever bothered to check, this would go unnoticed until the new user tried to logon to the LPAR. Oops. Moral of my story: Check!

Re: Alias creation by executing REXX.

PostPosted: Thu Oct 28, 2010 4:42 pm
by jaggz
Without the catalog parameter, it will only catalog it in system where the REXX runs on
.

Pedro here i just want to place the Alias only to a specific catalog. So that for a future audit trail it would be good for us to view it.

Re: Alias creation by executing REXX.

PostPosted: Thu Oct 28, 2010 7:32 pm
by Pedro
So that for a future audit trail it would be good for us to view it.


Yes, that is what cataloging it correctly will do.