Alias creation by executing REXX.



IBM's Command List programming language & Restructured Extended Executor

Alias creation by executing REXX.

Postby jaggz » Mon Oct 25, 2010 1:37 pm

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.
User avatar
jaggz
 
Posts: 356
Joined: Fri Jul 23, 2010 8:51 pm
Has thanked: 8 times
Been thanked: 5 times

Re: Alias creation by executing REXX.

Postby expat » Mon Oct 25, 2010 1:55 pm

Yes, but you will need to write it yourself.
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: Alias creation by executing REXX.

Postby NicC » Mon Oct 25, 2010 6:49 pm

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

Re: Alias creation by executing REXX.

Postby steve-myers » Mon Oct 25, 2010 9:53 pm

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!
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Alias creation by executing REXX.

Postby Pedro » Thu Oct 28, 2010 1:26 am

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.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Alias creation by executing REXX.

Postby steve-myers » Thu Oct 28, 2010 8:24 am

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!
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Alias creation by executing REXX.

Postby jaggz » Thu Oct 28, 2010 4:42 pm

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.
User avatar
jaggz
 
Posts: 356
Joined: Fri Jul 23, 2010 8:51 pm
Has thanked: 8 times
Been thanked: 5 times

Re: Alias creation by executing REXX.

Postby Pedro » Thu Oct 28, 2010 7:32 pm

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.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post