MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TSO command through assembler

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
avd678
Beginner


Joined: 02 Nov 2005
Posts: 12
Topics: 3

PostPosted: Thu Jan 08, 2009 9:16 am    Post subject: TSO command through assembler Reply with quote

Hi,

I would greatly appreciate if somebody can help to post the sample assembly code to issue TSO command through assembler. Like RACF TSO commands(e.g LU , ALU) through assembly code.

Thanks
avd678
_________________
avd
Back to top
View user's profile Send private message Yahoo Messenger
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Thu Jan 08, 2009 3:11 pm    Post subject: Reply with quote

Care to elaborate on what you're trying to accomplish?
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
avd678
Beginner


Joined: 02 Nov 2005
Posts: 12
Topics: 3

PostPosted: Thu Jan 08, 2009 9:11 pm    Post subject: Reply with quote

Hi,

I want to execute tso RACF command ALTUSER Resume & Revoke through Assebly code. Then I would like to compile and link edit that code.

Would appreciate some tips and sample code to build this kind of assembly code.

Thanks
_________________
avd
Back to top
View user's profile Send private message Yahoo Messenger
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Fri Jan 09, 2009 2:52 am    Post subject: Reply with quote

I can not really see a valid reason to go to the trouble of running TSO commands from an assembler program when running them from TSO will suffice.

Also, from TSO the input parameters are easily varied. And either way, from TSO or via assembler or whatever, the user will need RACF SPECIAL priviliges.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
avd678
Beginner


Joined: 02 Nov 2005
Posts: 12
Topics: 3

PostPosted: Fri Jan 09, 2009 4:47 am    Post subject: Reply with quote

Hi,

We are doing this activity as a part of autimation and my scurity team will provide the SPECIAL privilage to my started task id, which is suppose to execute this code.
Do you have any sample assembler code to issue tso commands?

Thanks
avd678
_________________
avd
Back to top
View user's profile Send private message Yahoo Messenger
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Fri Jan 09, 2009 11:18 am    Post subject: Reply with quote

If you must do something with program automation, simply create batch TSO JCL containing the RACF commands and submit from the program to the INTRDR.
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Fri Jan 09, 2009 6:38 pm    Post subject: Reply with quote

I think that the "right" way to do this is through the RACROUTE macro but I have never used it so that could be wrong.

Still... the easiest way to run TSO commands is to let ISPF services' SELECT CMD() do it for you. You can do that from assembler easily, but since this is a started task that will probably not be getting very much activity (like, say, a web server would), and since you are already running TSO (ikjeft01) and presumably ISPF in it, you may want to just write most of the thing in Rexx or even CLIST. That way you can take advantage of the outtrap capabilities and trap the output of the commands and thus provide better error handling.

Failing that, if for some reason you don't want your program to be running under TSO, you can attach IKJEFT01 with the parm string being the command but that is more overhead than just running the whole thing within TSO.

Its been decades since I did anything like this, but I think you can use IKJEFTSR to invoke commands.
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
avd678
Beginner


Joined: 02 Nov 2005
Posts: 12
Topics: 3

PostPosted: Sat Jan 10, 2009 4:42 am    Post subject: Reply with quote

Hi,

There are limitations to run tso commands through my automation product as it does not support TSO external commands. I already tried batch job option with IKFEFT01 but problem is we have no control when the job will run! There are chances that it may get stuck in the input queue for long time.
I already work out the option of doing it through started task but I feel there should be some other efficient options like doing it through assembly code or through RACF macro..
I will also try this IKJEFTSR, let see if it works in my environment.

Thanks
avd678
_________________
avd
Back to top
View user's profile Send private message Yahoo Messenger
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Sat Jan 10, 2009 11:31 pm    Post subject: Reply with quote

avd678, You probably know this, but just for completeness for anyone reading my previous comments...

IKJEFTSR will only work if you are already running under TSO (IKJEFTxx) which can be done in batch or as a started task. You can have the started task be a TSO task by having the task JCL start IKJEFT01 with a parameter that is the TSO command to run. In this case, the command would be the command that starts your program and TSO will start that command and your program will then have access to TSO services like IKJEFTSR. To use ISPF services, you'd start TSO passing a command of ISPSTART PGM(...) or similar and then have the command that ISPF runs start your program. Then your program has both TSO and ISPF services available. This is how the old LMF task in ISPF used to run (LMF is no longer in existence).

But definitely look at the RACROUTE macro to see if it can do what you need since it is the documented and efficient access to SAF which is used by RACF as well as other security products.
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
avd678
Beginner


Joined: 02 Nov 2005
Posts: 12
Topics: 3

PostPosted: Sun Jan 11, 2009 3:12 am    Post subject: Reply with quote

semigeezer,

Thank you so much for your advice, definitely I will try both the options and see which option best fit to accomplish this task.

Regards
avd678
_________________
avd
Back to top
View user's profile Send private message Yahoo Messenger
avd678
Beginner


Joined: 02 Nov 2005
Posts: 12
Topics: 3

PostPosted: Mon Jan 12, 2009 12:28 am    Post subject: Reply with quote

Hi,

I am trying following rexx code to call IKJEFTSR
Code:

STORAGE_AREA  = LEFT('00000000'X,4)                             
CMD = 'LU AOABT'                                               
DATA_AREA     = LEFT('00000000'X,4)                             
ARG_NAMES     = LEFT(' ',8)                                     
ARG_VALUES    = LEFT('00000000'X,4)                             
COMM_BLOCK    = LEFT('00000000'X,4)                             
RETURN_CODE   = LEFT('00000099'X,4)                             
REASON_CODE   = LEFT('00000099'X,4)                             
THIS_PARM = 'STORAGE_AREA CMD DATA_AREA ARG_NAMES ARG_VALUES COMM_BLOCK RETURN_CODE'                           
ADDRESS LINKPGM "IKJEFTSR" THIS_PARM               

But it's giving me return code 20 (Paramter list error)....
Anybody have tried similar code before?
Appreciate if can provide some heads up here..

Thanks
avd
_________________
avd
Back to top
View user's profile Send private message Yahoo Messenger
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Mon Jan 12, 2009 12:37 pm    Post subject: Reply with quote

I wasn't able to get it to work either with a corrected parm list but why use IKJEFTSR from Rexx? If you are under TSO, you can just issue the command directly and if you aren't under TSO, you can't use TSO commands or IKJEFTSR
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
avd678
Beginner


Joined: 02 Nov 2005
Posts: 12
Topics: 3

PostPosted: Tue Jan 13, 2009 6:40 am    Post subject: Reply with quote

My problem is, our automation tool does support TSO environment but it does not support TSO external commands (i.e LU, ALU). So I am looking for some other options which will run well through my automation product.
One option I have tried is submitting JOB/STC(using IKJEEFT01 and submitting TSO command externally) but this would be my last choice to accomplish this task. I would like to do it directly through my code.
_________________
avd
Back to top
View user's profile Send private message Yahoo Messenger
taltyman
JCL Forum Moderator
JCL Forum Moderator


Joined: 02 Dec 2002
Posts: 310
Topics: 8
Location: Texas

PostPosted: Tue Jan 13, 2009 8:47 am    Post subject: Reply with quote

Does your racf stc allow you to issue commands to it directly from a console? We can issue xxx lu commands from the console (where xxx is the recognition string for racf). Your AO product should then be able to issue the racf command and see the response.
Back to top
View user's profile Send private message
avd678
Beginner


Joined: 02 Nov 2005
Posts: 12
Topics: 3

PostPosted: Tue Jan 13, 2009 11:41 am    Post subject: Reply with quote

Yup, I already thought of using that option but drawback of using RACF console commands is, if my code is issuing #ALU command then temporary password will get exposed in syslog or if I try to suppress it from console then also it will be visible in stc log!
So I was looking for option where I can call any RACROUTE or IKJEFT* program directly from my code to issue RACF command..
_________________
avd
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group