Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calling IDCAMS from REXX

1,470 views
Skip to first unread message

sro

unread,
Feb 15, 2007, 8:34:33 PM2/15/07
to
So I'm trying to do something simple.

I know I can do this:

/* rexx */

alloc fi(sysin) da(in) shr reu /* assumes correct idcams stmts */
alloc fi(sysprint) da(*)
call 'sys1.linklib(idcams)'

and the output will be put up on the tso terminal

I need to find a way to feed idcams so I can capture the output via
outtrap.

Anyone have any examples / ideas on this simple aspect?

TIA
---SRO

Arthur T.

unread,
Feb 15, 2007, 10:37:17 PM2/15/07
to
In Message-ID:<JS7Bh.13176$Yn4.1098@trnddc03>,
sro <sro...@verizon.net> wrote:

Just about all of the IDCAMS commands can be typed as TSO
commands. Have you tried just executing the statements? (You may
have to put them into a wide dataset with one line per statement.)

As an alternative: Rather than allocating SYSPRINT to the
terminal, allocate it to a dataset, and read that dataset.

P.S.
Since you're not munging your address, anyway, you should
join and post via the Listserv. Your question will be seen by
many more people, that way.

--
Arthur T. - ar23hur "at" intergate "dot" com
Looking for a z/OS (IBM mainframe) systems programmer position

sro

unread,
Feb 16, 2007, 1:25:05 AM2/16/07
to
Arthur T. wrote:
> In Message-ID:<JS7Bh.13176$Yn4.1098@trnddc03>,
> sro <sro...@verizon.net> wrote:
>
>> So I'm trying to do something simple.
>>
>> I know I can do this:
>>
>> /* rexx */
>>
>> alloc fi(sysin) da(in) shr reu /* assumes correct idcams stmts */
>> alloc fi(sysprint) da(*)
>> call 'sys1.linklib(idcams)'
>>
>> and the output will be put up on the tso terminal
>>
>> I need to find a way to feed idcams so I can capture the output via
>> outtrap.
>>
>> Anyone have any examples / ideas on this simple aspect?
>
> Just about all of the IDCAMS commands can be typed as TSO
> commands. Have you tried just executing the statements? (You may
> have to put them into a wide dataset with one line per statement.)
>
> As an alternative: Rather than allocating SYSPRINT to the
> terminal, allocate it to a dataset, and read that dataset.
>
> P.S.
> Since you're not munging your address, anyway, you should
> join and post via the Listserv. Your question will be seen by
> many more people, that way.
>

--------------------------------------------------------------


Since you're not munging your address, anyway, you should
join and post via the Listserv. Your question will be seen by
many more people, that way.

--------------------------------------------------------------

Can someone explain what "MUNGING your address" is and how do I join &
post via the Listserv?

I did think about allocating sysprint to a dataset and reading it but I
suspected there would be an easier way.... it's late and I'll need to
try it in the morning.. thanks

TIA
---SRO

Bob Welch

unread,
Feb 16, 2007, 10:37:20 AM2/16/07
to
Do not know what munging your address is, but here is an example of a
Rexx that calls Idcams, and builds the statements to a sysin file,
that is passed to Idcams. It was made to run in batch, but can be
executed from your Tso session as well. You'll need to get read of the
ISPFREAD call, as that was done to get a system variable, which was
then used to determine what file naminf structure to use. Bottom line
is, modify it to suit your needs, there is a write to the sysin
ddname, then a call to Idcams, add an allocate sysprint statement,
modeling what is in the sysin, but change it to be vba, lrecl(129),
then you've captured the output after a succesful call, then you can
read the sysprint ddname (execio) .
Sorry for not finding one I'd written 12-15 years ago that did just
that. I'd have to go through them for a while to find a better
candicate, but the below can be the framework, used with the
allocation of sysprint given above.

Modify it to suit your needs.
/* REXX UTILITY CLIST
*/
PARSE UPPER ARG WITH '/' DEBUGVAR '/' FUNCVAR '/' SAYVAR
'/',
RESTDATA
'/'
IF DEBUGVAR = 'DEBUG' THEN TRACE
R

PASSBACK='ISPFREAD'()
PARSE VAR PASSBACK ISPFSID ISPFABBR ISPFMVS
REST
FUNCVAR =
STRIP(FUNCVAR)
SAYVAR =
STRIP(SAYVAR)
CALL
BKB_INIT
CALL MULTILBL
FUNCVAR
CALL
WRITE_SUN
IF FUNCVAR = 'CAMSIT' | FUNCVAR = 'CAMSEXIST'
THEN
CALL
ATTATCH_IDCAMS
ELSE
NOP
IF RCODE = 16
THEN

DO
SAY ' WE ARE GOING TO ABEND THIS SO WE GET NOTICED....
'
SAY 'CAMS LOCATE ERROR - ON A FILE VIA LISTCAT - VIEW SYSPRINT
DDNAME'

END
EXIT
RCODE
BKB_INIT:
DATAOUT =
0
RCODE =
0
T. =
0

SELECT
WHEN ISPFSID = "A70N"
THEN,
DO; SUNDBASE = "SMS10P.SYSA";
END;
WHEN ISPFSID = "SYS2"
THEN,
DO; SUNDBASE = "SMS10P.SYS2";
END;
WHEN ISPFSID = "H80C"
THEN,
DO; SUNDBASE = "SMS10P.SYSH";
END;
WHEN ISPFSID = "I90C"
THEN,
DO; SUNDBASE = "SMS10P.SYSH";
END;
WHEN ISPFSID = "L90C"
THEN,
DO; SUNDBASE = "SMS10P.SYSH";
END;
WHEN ISPFSID = "O90C"
THEN,
DO; SUNDBASE = "SMS10P.SYSH";
END;
WHEN ISPFSID = "VT2N"
THEN,
DO; SUNDBASE = "SMS10P.SYSSMS";
END;

OTHERWISE
SUNDBASE =
"INVALID.DATASET.NAME.BADISPFSYSID"

END
RETURN
0
/* MULTILBL: PROCEDURE
*/
MULTILBL:
ARG LABEL . /* ONE WORD, UPPER CASE
*/
/* CAN ADD CHECKS FOR VALID LABELS HERE
*/
SIGNAL VALUE LABEL /* TRANSFER CONTROL TO WHEREVER
*/
RETURN
0
SRNEW:
DATAOUT =
5
DDOUT =
"SUNOUT"
T.1="DATABASE "||
SUNDBASE||";"
T.2="SELECT
ADRAPPL,ADRJNAM,ADRJTYPE,ADRDESC"
T.3=" FROM ADR WHERE ADRAPPL = '$
$SRNEW';"
T.4=" ORDER BY ADRAPPL,
ADRJNAM"
T.5=" GROUP BY ADRAPPL,
ADRJNAM"
RETURN
0
CAMSIT:
DATAOUT =
6
DDOUT =
"SYSIN"
ADDRESS TSO "ALLOC FI(SYSIN) DA('SMS00P.SYSIN.SUNBKUTL') NEW
LRECL(80),
BLKSIZE(0) RECFM(F B)
DELETE"
T.1 = " LISTCAT ENT('"||RESTDATA||"')"||" GDG
NAME"
T.2 = " IF LASTCC = 4 THEN DO
"
T.3 = " SET MAXCC = 0
"
T.4 = " DEFINE GDG (NAME('"||RESTDATA||"') LIMIT(5)
SCRATCH)"
T.5 = "
END"
T.6 = " ELSE SET MAXCC =
0"
RETURN
0
CAMSEXIST:
DATAOUT =
5
DDOUT =
"SYSIN"
ADDRESS TSO "ALLOC FI(SYSIN) DA('SMS00P.SYSIN.SUNBKUTL') NEW
LRECL(80),
BLKSIZE(0) RECFM(F B)
DELETE"
T.1 = " LISTCAT ENT('"||RESTDATA||"')"||"
NAME"
T.2 = " IF LASTCC = 4 THEN DO
"
T.3 = " SET MAXCC =
16"
T.4 = "
END"
T.5 = " ELSE SET MAXCC =
0"
RETURN
0
ATTATCH_IDCAMS:
ADDRESS ATTCHMVS
"IDCAMS"
RCODE =
RC
SAY "IDCAMS RETURN CODE IS:"
RCODE
RETURN
RCODE
WRITE_SUN:
DO I = 1 TO
DATAOUT
QUEUE
T.I
IF SAYVAR = "SAY" THEN SAY
T.I
"EXECIO * DISKW" DDOUT
"( OPEN"

END

DELSTACK
QUEUE
""
"EXECIO 0 DISKW" DDOUT
"( FINIS"
RETURN
0

> ---SRO- Hide quoted text -
>
> - Show quoted text -

Arthur T.

unread,
Feb 16, 2007, 4:02:17 PM2/16/07
to
In Message-ID:<57cBh.2176$yg7.877@trnddc08>,
sro <sro...@verizon.net> wrote:

>Can someone explain what "MUNGING your address" is and how do I join &
>post via the Listserv?

Last first. At the bottom of every post made via the
Listserv are these lines:

>For TSO-REXX subscribe / signoff / archive access instructions,
>send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

First last. Notice my e-mail address in the headers. It's
<art...@munged.invalid>. Any bot harvesting e-mail addresses for
spam won't get anything from that. My sig has my actual e-mail
address. HOW you mung will depend on your newsreader, and I'm not
familiar enough with Thunderbird to give you details. I'd suggest
a Google on MUNG and THUNDERBIRD.

(Some Listservs auto-mung addresses when mirroring them to
Usenet. TSO-REXX doesn't, so I don't post via the Listserv,
here.)

0 new messages