IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Using IRXJCL to execute REXX with pipes


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dkoppit

New User


Joined: 23 Feb 2010
Posts: 17
Location: Omaha, NE

PostPosted: Tue Feb 23, 2010 8:04 pm
Reply with quote

I have tried in the past to execute REXX containing Pipes from a JCL using the IRXJCL program. I have never been successful, always getting the "unmatched quote" error. These REXXs run fine if executed in AutoOps or from an MVS console. Somebody in my company stated that there is a "batch pipe" program/JCL utility we need to purchase to do this.
So, first question: Is there any way to execute a REXX w/ pipes from a JCL using IRXJCL?
Second: If you can't use IRXJCL, is there such a beast as "BatchPipe" to use for this task. I have Googled my fingers away and haven't found anything.

Here is an example of what i am trying to do. I have tried this command with & without the 'MVS', and I have tried the pipe both separated and in one line.

JCL
Code:

//ICCG004X JOB (TE,APC,,8001,5,25),ICCG004,CLASS=C,MSGCLASS=H
//*                                                         
//SETPARMS    EXEC PGM=IRXJCL,PARM='DDKTEST'                 
//SYSEXEC  DD DSN=AOF.COMMON.CLIST,DISP=SHR                 
//SYSIN DD DUMMY                                             
//SYSPRINT DD DUMMY                                         
//*                                                         
//SYSTSPRT DD SYSOUT=*                                       
//*                                                         


REXX
Code:

/* REXX - TEST */                                                     
TRACE OFF                                                             
LPAR = 'TESTER'                                                       
/*'PIPE CC MVS D IOS,CONFIG |SEP |LOC /LPAR/ |EDIT WORD 4 |VAR LPAR'*/
'PIPE CC MVS D IOS,CONFIG',                                           
' |SEP',                                                             
' |LOC /LPAR/',                                                       
' |EDIT WORD 4',                                                     
' |VAR LPAR'                                                         
SAY 'LPAR IS 'LPAR                                                   
EXIT                                                                 


Output
Code:

     2 +++ 'PIPE  CC MVS |                                   
    | FILTER  - DATA                                         
EPERATE -                                                     
- DISCARD RECORDS THAT MATCH SPECIFIED CRITERIA               
THE VALUE OF X IN SECONDS                                     
IRX0006I Error running PIPE, line 2: Unmatched "/*" or quote 
LPAR IS TESTER                                               
[/code]
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Feb 23, 2010 8:11 pm
Reply with quote

it would be better to run with a trace "I" to see what is going on
( Trace "I" means : show the intermediate values of the variables )
Back to top
View user's profile Send private message
dkoppit

New User


Joined: 23 Feb 2010
Posts: 17
Location: Omaha, NE

PostPosted: Tue Feb 23, 2010 8:30 pm
Reply with quote

Output from TRACE I, everything past column 80 is chopped (i completed a couple lines), let me know if you need all 253 cols copied.

This output doesn't tell me anymore, hopefully your insight will help, thanks.

Code:

     3 *-* LPAR = 'TESTER'                                                     
       >L>   "TESTER"                                                           
     4 *-* /*'PIPE CC MVS D IOS,CONFIG |SEP |LOC /LPAR/ |EDIT WORD 4 |VAR LPAR'*/
     5 *-* 'PIPE CC MVS D IOS,CONFIG',                                         
                                                    ' |VAR LPAR'               
       >L>   "PIPE CC MVS D IOS,CONFIG"                                         
       >L>   " |SEP"                                                           
       >O>   "PIPE CC MVS D IOS,CONFIG  |SEP"                                   
       >L>   " |LOC /LPAR/"                                                     
       >O>   "PIPE CC MVS D IOS,CONFIG  |SEP  |LOC /LPAR/"                     
       >L>   " |EDIT WORD 4"                                                   
       >O>   "PIPE CC MVS D IOS,CONFIG  |SEP  |LOC /LPAR/  |EDIT WORD 4"       
       >L>   " |VAR LPAR"                                                       
       >O>   "PIPE CC MVS D IOS,CONFIG  |SEP  |LOC /LPAR/  |EDIT WORD 4  |VAR LPAR"
     2 +++ 'PIPE  CC MVS |                                                     
    | FILTER  - DATA                                                           
EPERATE -                                                                    | S
- DISCARD RECORDS THAT MATCH SPECIFIED CRITERIA                       | LOC /DSN
THE VALUE OF X IN SECONDS                                      | COLOR  X - COLO
IRX0006I Error running PIPE, line 2: Unmatched "/*" or quote                   
       +++ RC(20006) +++                                                       
    10 *-* SAY 'LPAR IS 'LPAR                                                   
       >L>   "LPAR IS "                                                         
       >V>   "TESTER"                                                           
       >O>   "LPAR IS TESTER"                                                   
LPAR IS TESTER                                                                 
    11 *-* EXIT   
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Feb 23, 2010 9:20 pm
Reply with quote

looks like You have something called PIPE in the SYSEXEC dataset
and REXX complains about a missing /* there at line 2!

there is no error in line 2 of the REXX script as posted
Back to top
View user's profile Send private message
dkoppit

New User


Joined: 23 Feb 2010
Posts: 17
Location: Omaha, NE

PostPosted: Tue Feb 23, 2010 9:53 pm
Reply with quote

I understand that it complains about a missing quote or /* on line 2, but that is false. Executing this REXX from AO works fine, there is no actual syntax error in my Pipe command. I'm trying to figure out why using IRXJCL is causing this error (maybe it requires a different syntax?). And if IRXJCL is not able to handle Pipes, is there another JCL program/utility out there to handle them. (i have heard of a BatchPipe program, but can't find any info about it)
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Feb 23, 2010 10:12 pm
Reply with quote

try running it from a batch tso IKJEFT01
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Tue Feb 23, 2010 10:13 pm
Reply with quote

Have you verified that sysexec doesn't contain a member called PIPE?
Back to top
View user's profile Send private message
dkoppit

New User


Joined: 23 Feb 2010
Posts: 17
Location: Omaha, NE

PostPosted: Tue Feb 23, 2010 11:09 pm
Reply with quote

Thanks MBabu & enrico, I did find I had a 'PIPE' clist in my SYSEXEC library which solves the missing quote error. However, I guess I'm back to the old RC(-3) problem.

I have tried addressing MVS,TSO, and NETVIEW to no avail. The default address is MVS so I tried the command without MVS in front, no go. I believe that the RC(-3) refers to being in the wrong address.....so is there any address space I am missing that this REXX needs to be in to run these pipes from this JCL?

Again, thanks for helping with the initial 'no quote' errors, but I think this RC(-3) is my actual problem.
Back to top
View user's profile Send private message
dkoppit

New User


Joined: 23 Feb 2010
Posts: 17
Location: Omaha, NE

PostPosted: Tue Feb 23, 2010 11:10 pm
Reply with quote

Forgot to post RC(-3) output...

Code:

     3 *-* LPAR = 'TESTER'                                                     
       >L>   "TESTER"                                                         
     4 *-* SAY 'ADDRESS IS 'ADDRESS()                                         
       >L>   "ADDRESS IS "                                                     
       >F>   "MVS"                                                             
       >O>   "ADDRESS IS MVS"                                                 
ADDRESS IS MVS                                                                 
     5 *-* 'PIPE CC MVS D IOS,CONFIG |SEP |LOC /LPAR/ |EDIT WORD 4 |VAR LPAR' 
       >L>   "PIPE CC MVS D IOS,CONFIG |SEP |LOC /LPAR/ |EDIT WORD 4 |VAR LPAR"
       +++ RC(-3) +++                                                         
     6 *-* SAY 'LPAR IS 'LPAR                                                 
       >L>   "LPAR IS "                                                       
       >V>   "TESTER"                                                         
       >O>   "LPAR IS TESTER"                                                 
LPAR IS TESTER                                                                 
     7 *-* EXIT                                                               
Back to top
View user's profile Send private message
dkoppit

New User


Joined: 23 Feb 2010
Posts: 17
Location: Omaha, NE

PostPosted: Tue Feb 23, 2010 11:48 pm
Reply with quote

Enrico, here is the IKJEFT01 output:

Command w/ MVS, address defaults to TSO, pipe command not found & RC(-3):
Code:

     3 *-* LPAR = 'TESTER'                                                     
       >L>   "TESTER"                                                           
     4 *-* SAY 'ADDRESS IS 'ADDRESS()                                           
       >L>   "ADDRESS IS "                                                     
       >F>   "TSO"                                                             
       >O>   "ADDRESS IS TSO"                                                   
ADDRESS IS TSO                                                                 
     5 *-* 'PIPE CC MVS D IOS,CONFIG |SEP |LOC /LPAR/ |EDIT WORD 4 |VAR LPAR'   
       >L>   "PIPE CC MVS D IOS,CONFIG |SEP |LOC /LPAR/ |EDIT WORD 4 |VAR LPAR"
IKJ56500I COMMAND PIPE NOT FOUND                                               
       +++ RC(-3) +++                                                           
     6 *-* SAY 'LPAR IS 'LPAR                                                   
       >L>   "LPAR IS "                                                         
       >V>   "TESTER"                                                           
       >O>   "LPAR IS TESTER"                                                   
LPAR IS TESTER                                                                 
     7 *-* EXIT                                                                 
READY                                                                           
END                                                                             


Command w/o MVS, Address changed to MVS, only RC(-3):
Code:

     3 *-* LPAR = 'TESTER'                                                 
       >L>   "TESTER"                                                     
     4 *-* ADDRESS MVS                                                     
     5 *-* SAY 'ADDRESS IS 'ADDRESS()                                     
       >L>   "ADDRESS IS "                                                 
       >F>   "MVS"                                                         
       >O>   "ADDRESS IS MVS"                                             
ADDRESS IS MVS                                                             
     6 *-* 'PIPE CC D IOS,CONFIG |SEP |LOC /LPAR/ |EDIT WORD 4 |VAR LPAR' 
       >L>   "PIPE CC D IOS,CONFIG |SEP |LOC /LPAR/ |EDIT WORD 4 |VAR LPAR"
       +++ RC(-3) +++                                                     
     7 *-* SAY 'LPAR IS 'LPAR                                             
       >L>   "LPAR IS "                                                   
       >V>   "TESTER"                                                     
       >O>   "LPAR IS TESTER"                                             
LPAR IS TESTER                                                             
     8 *-* EXIT                                                           
READY                                                                     
END                                                                       
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Wed Feb 24, 2010 1:13 am
Reply with quote

I think it is self explanatory -- the command PIPE is not found in either case.

Check your steplib/joblib/ispllib concatenation to see that the library containing the PIPE command is there. If it isn't there, you need to add it. If this works from TSO (online) use the DDLIST LOAD PIPE commannd to find the load module.

and maybe... since you had an old exec called PIPE before, have a look at it to see what it does (assuming that it was a working invocation of pipes).
Back to top
View user's profile Send private message
dkoppit

New User


Joined: 23 Feb 2010
Posts: 17
Location: Omaha, NE

PostPosted: Wed Feb 24, 2010 4:27 am
Reply with quote

The old PIPE in our clistlib was not a functioning PIPE exec, it was simply full of comments about pipes. I cannot see a PIPE member in any of my AO or NETV concatenations.

I'm perplexed why it can't find the PIPE command when executing the REXX from IRXJCL. PIPE is a legitimate Netview command. Why can't i set the Address (environment) to Netview, and have it execute netview commands, just as I do with MVS or TSO commands?

As far as I can tell, this information is nowhere to be found in any other redbook/manual/forum/google search that I have seen.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Feb 24, 2010 2:21 pm
Reply with quote

Did you try :

ADDRESS NETVIEW pipe command ?

And why would one run NETVIEW commands in batch?
Back to top
View user's profile Send private message
dkoppit

New User


Joined: 23 Feb 2010
Posts: 17
Location: Omaha, NE

PostPosted: Wed Feb 24, 2010 7:27 pm
Reply with quote

Peter,
Yes, I have tried addressing Netview, as well as MVS and TSO just to try things. But addressing NETVIEW doesn't appear to work the same from IRXJCL as when I address MVS and use an MVS command.

There are plenty of times when I want to run a JCL that calls a REXX using IRXJCL. As far as I can tell REXX is much easier to pick apart, parse and interrogate a dsn over JCL (not even sure if JCL can do this). When that JCL has to be on a schedule, it's much more to convenient to have the JCL call the REXX, rather than have the REXX on an approximate timer pop, then have it go out and look to see of the JCL finished properly, then execute the REXX.

Also, it is much easier and more efficient to use Pipes:
Code:

'PIPE CC MVS D IOS,CONFIG',
' |SEP',                   
' |LOC /SYSTEM/',         
' |EDIT WORD 2',           
' |VAR V2'             



rather than use this:
Code:

  'TRAP AND SUPPRESS ONLY MESSAGES IOS506I'   
  "MVS  D IOS,CONFIG"                         
  'WAIT 10 SECONDS FOR MESSAGES'             
   SELECT                                     
        WHEN EVENT()='M' THEN SIGNAL IOS506   
        WHEN EVENT()='T' THEN SIGNAL TIMED_OUT
   OTHERWISE NOP; END                         
IOS506:                                       
  'MSGREAD'                                   
  'GETMLINE LINE 5'                           
   PARSE VAR LINE V1 V2 V3 V4 V5 V6 .         
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Wed Feb 24, 2010 8:17 pm
Reply with quote

We do not have Netview on our development sysplex, so I cannot speak with any certainly here. Is it possible, though, that you must create the Netview environment yourself in a non-TSO address space, i.e., invoking the script through IRXJCL?
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Wed Feb 24, 2010 10:32 pm
Reply with quote

I am not a plumber (someone that works with Pipes) so all I can offer is that you get "Programming: REXX and the NetView Command List Language
Version 5 Release 4", SC31-8862.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Wed Feb 24, 2010 10:49 pm
Reply with quote

Actually, this might be better book: "IBM Tivoli NetView for z/OS
Programming: Pipes Version 5 Release 4", SC31-8863.
Back to top
View user's profile Send private message
dkoppit

New User


Joined: 23 Feb 2010
Posts: 17
Location: Omaha, NE

PostPosted: Thu Feb 25, 2010 12:41 am
Reply with quote

Akatsukami,
I already call the REXX from IRXJCL, so the default Address when run from that non-TSO address space is MVS. The PIPE command won't work from MVS address as suspected, so I use 'ADDRESS NETVIEW' command to change environment to Netview (hopefully), but the command still isn't found. I do a 'say' in my rexx to verify the address set as NETVIEW (i have tried NETV also).
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Thu Feb 25, 2010 1:39 am
Reply with quote

The address command will always switch to what you tell it to:
Address XYZZY
say address()
will print XYZZY even if no such subcommand environment exists.

If the command isn't found then you need to have the correct load libraries in STEPLIB. Netview may have other requirements as well to establish the environment. I've never used netview but I doubt that just running a command directly through IRXJCL will work since there is nothing to set up the subcommand environment (much like running an ISPF program won't work unless you start it within ISPF).
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Feb 25, 2010 2:00 am
Reply with quote

Way off the topic, but. . .

Quote:
Address XYZZY

An Adventure in addressing . . . ?

Quote:
Entering the command from other locations produces the disappointing response "Nothing happens."


icon_wink.gif

d
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Thu Feb 25, 2010 4:31 am
Reply with quote

YOU ARE STANDING AT THE END OF A ROAD BEFORE A SMALL BRICK BUILDING. AROUND YOU IS A FOREST. A SMALL STREAM FLOWS OUT OF THE BUILDING AND DOWN A GULLY.

Extra points for Mr Scherrer today!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Feb 25, 2010 4:41 am
Reply with quote

There is a wumpus nearby ....
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Feb 25, 2010 1:18 pm
Reply with quote

dkoppit wrote:
Peter,
Yes, I have tried addressing Netview, as well as MVS and TSO just to try things. But addressing NETVIEW doesn't appear to work the same from IRXJCL as when I address MVS and use an MVS command.

There are plenty of times when I want to run a JCL that calls a REXX using IRXJCL. As far as I can tell REXX is much easier to pick apart, parse and interrogate a dsn over JCL (not even sure if JCL can do this). When that JCL has to be on a schedule, it's much more to convenient to have the JCL call the REXX, rather than have the REXX on an approximate timer pop, then have it go out and look to see of the JCL finished properly, then execute the REXX.


dkoppit,

IRXJCL is part of TSO/E which is part of MVS, so you can change to TSO, MVS and ISPF. In my automation days i remember vaguely that running pure NCCF commands (like PIPE) is not possible in MVS (IRXJCL).
So in that case I always used a timer (and yes thats also a kind of scheduling) to run things under NETVIEW. Beside that i agree that PIPE is
a nice command but not all MVS/NETVIEW commands are traped by PIPE.
So you end up with a mix of PIPES and/or TRAP rexx routines.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Sun Feb 28, 2010 3:01 pm
Reply with quote

Oops, i forgot about the TWS/Netview interface to run netview commands
in batch, cause i never used that.

The following manual will give you the info how to use the EVJRYCMD
command in your IKJEFT01 jcl/procedure :

TWS Automation Programmer’s Reference and Operator’s Guide SC33-8269
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top