Page 1 of 2

Store the output of tso whois command using REXX

PostPosted: Mon Sep 30, 2013 2:16 pm
by Dheeraj Sharma
How to store the output of tso whois command using REXX in output file?

Re: REXX

PostPosted: Mon Sep 30, 2013 2:29 pm
by Stefan
If the WHOIS command does not use the TPUT macro to write its output to the terminal, it is possible to trap the output by using the OUTTRAP() function.
Sample:
x = outtrap(.trap)
address tso "whois myuserid"
x = outtrap('OFF')
do i = 1 by 1 to trap.0
   say trap.i
end

Re: Store the output of tso whois command using REXX

PostPosted: Mon Sep 30, 2013 9:04 pm
by Akatsukami
Remember that WHOIS is not a TSO command, but a popular name for locally-written CLISTs and execs that give information about a user. Inspection of the code may be necessary.

Re: Store the output of tso whois command using REXX

PostPosted: Mon Sep 30, 2013 9:23 pm
by Pedro
re:
x = outtrap(.trap)

I think it should be:
x = outtrap('trap.')

Because the period should be at the end.


How to store the output of tso whois command using REXX in output file?

Use the same stem in the EXECIO as is used in the OUTTRAP
x = outtrap('trap.')
address tso "whois myuserid"
x = outtrap('OFF')
Address TSO "ALLOC FILE(TRAPDD) BLKSIZE(0) LRECL(133) NEW REU",       
            " SPACE(5,5) CYL RECFM(F,B) "                               
Address TSO 'EXECIO ' trap.0 ' DISKW TRAPDD ( FINIS  STEM TRAP.'

Re: Store the output of tso whois command using REXX

PostPosted: Thu Oct 03, 2013 9:22 am
by Dheeraj Sharma
Hi All,
Thanks you for your valuable responses, however still i am not able to store it in output file. I am just a beginner so pardon me if i am wrong somewhere. Below is my JCL plz tell me if i am wrong somewhere

//$REXXB1 JOB (0301,CO-04-21,022602,CLA,195,64628),'REXX1 JOB',
// MSGCLASS=T,NOTIFY=SINGA1
//*MAIN CLASS=S4,USER=SINGA1
//*
//STEP010 EXEC PGM=IKJEFT01,
// PARM='NEW'
//*
//SYSEXEC DD DSN=T030.WORK.DHEERAJ.REXX1,
// DISP=SHR
//*
//SYSTSIN DD *
/*
//*
//IN DD *
ID1
ID2
ID3
/*
//FILEOUT DD DSN=T030.WORK.DHEERAJ.REXX1.OUTFIL,
// DISP=(,CATLG,DELETE),
// SPACE=(TRK,(5,5),RLSE),
// DCB=(RECFM=FB,LRECL=80)
//*
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*


And below is my REXX

/* REXX */

"EXECIO * DISKR IN (FINIS"
IDCOUNT = QUEUED()
DO I = 1 TO IDCOUNT
PULL IN.I .
ADDRESS TSO "WHOIS" IN.I
X = OUTTRAP('TRAP.')
END
X = OUTTRAP('OFF')
ADDRESS TSO "ALLOC FILE(TRAPDD) BLKSIZE(0) LRECL(80) NEW",
" SPACE(5,5) TRK RECFM(F,B) "
ADDRESS TSO 'EXECIO DISKW FILEOUT ( FINIS STEM TRAP.'



Please help me regarding this, I would be very much grateful to you people.

Re: Store the output of tso whois command using REXX

PostPosted: Thu Oct 03, 2013 10:14 am
by Dheeraj Sharma
Pardon me for one thing ...instead of TRAPDD it is FILEOUT while allocating the file in REXX

Re: Store the output of tso whois command using REXX

PostPosted: Thu Oct 03, 2013 3:54 pm
by Akatsukami
The thing that leaps to the eye is that the invocation of WHOIS is outside of the OUTTRAPs. Move it to between them.

Re: Store the output of tso whois command using REXX

PostPosted: Thu Oct 03, 2013 4:22 pm
by Dheeraj Sharma
I have tried it inside also...still its not working

Re: Store the output of tso whois command using REXX

PostPosted: Thu Oct 03, 2013 4:30 pm
by Akatsukami
Then begin by adding a TRACE statement to your exec so that we and you can see how it is not working.

Re: Store the output of tso whois command using REXX

PostPosted: Thu Oct 03, 2013 4:35 pm
by Dheeraj Sharma
Sorry for bothering you again. Can you plz tell me about TRACE statement