Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interfacing C or C++ with TSO commands?

Status
Not open for further replies.

cpjust

Programmer
Sep 23, 2003
2,132
0
0
US
Hi,
I've been testing software on a z/OS mainframe for several months now, and I'm really getting quite annoyed by the serious deficiencies of the Rexx scripting language. :-(

Since I know C/C++ quite well in the Windows/UNIX world, I was wondering if anyone knows how to make a C/C++ program work with TSO commands?

Basically, I need to execute TSO commands like "AU testuser PASS(password)", as well as TSO commands that my company writes, and pipe the output to a file (dataset) or something, so I can see the output later from all the commands.

If I could translate all my fragile little Rexx scripts into real language like C or C++, my hair might not turn grey so fast. ;-)
 
I bought a couple Perl books, but I've never really had time to read them; so Perl wouldn't help me much right away.
As for Bash, I've used it to create simple automation scripts before, but I don't think it's very powerful for string parsing...

Another thing I'd like to do (and started doing in a clumsy way in Rexx) is writing generic commands that mimic the RACF command syntax for ADDUSER, ALTUSER, LISTUSER, DELUSER... but which detect whether they are running on RACF, ACF2 or TSS and issue the appropriate commands for the security system they're running on. So I need some good string parsing functions for that.
 
For commands and parameters separated by spaces, I thought bash was pretty good.


--
 
You're right, if they were separated by spaces it would be simple. But unfortunately, the syntax of some of the RACF commands is a little more complicated. For example:

AU testuser PASS(password) DFLTGRP(qa) OMVS(UID(99) HOME(/u) PROG(/bin/sh))

The keywords could be in any order, and could be mixed case. I need to detect which keywords were passed, and extract the parameters out of them so I can put together a different command string for ACF2 or TSS and pass those parameters to the new command string. For example:

TSS CREATE(testuser) PASSWORD(password,,EXPIRED) DEPARTMENT(qa) NAME(testuser) TYPE(user)
TSS ADD(testuser) DFLTGRP(qa) OMVS UID(99) HOME(/u) OMVSPGM(/bin/sh) NOADSP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top