Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Using IRXJCL to execute REXX with pipes
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Using IRXJCL to execute REXX with pipes
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Feb 23, 2010 8:11 pm    Post subject: Reply to: Using IRXJCL to execute REXX with pipes
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Feb 23, 2010 9:20 pm    Post subject: Reply to: Using IRXJCL to execute REXX with pipes
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Feb 23, 2010 10:12 pm    Post subject: Reply to: Using IRXJCL to execute REXX with pipes
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: 401
Location: Mumbai

PostPosted: Tue Feb 23, 2010 10:13 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 401
Location: Mumbai

PostPosted: Wed Feb 24, 2010 1:13 am    Post subject:
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    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Wed Feb 24, 2010 2:21 pm    Post subject:
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    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Wed Feb 24, 2010 8:17 pm    Post subject:
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

Senior Member


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

PostPosted: Wed Feb 24, 2010 10:32 pm    Post subject: Reply to: Using IRXJCL to execute REXX with pipes
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

Senior Member


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

PostPosted: Wed Feb 24, 2010 10:49 pm    Post subject: Reply to: Using IRXJCL to execute REXX with pipes
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    Post subject:
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: 401
Location: Mumbai

PostPosted: Thu Feb 25, 2010 1:39 am    Post subject:
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

Site Director


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

PostPosted: Thu Feb 25, 2010 2:00 am    Post subject: Reply to: Using IRXJCL to execute REXX with pipes
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us