MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to execute a program through REXX !!

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
amit4u79
Beginner


Joined: 24 Oct 2005
Posts: 109
Topics: 36
Location: India

PostPosted: Fri Jun 30, 2006 4:39 am    Post subject: How to execute a program through REXX !! Reply with quote

Hi,

I have the following JCL which uses a system program PING to ping an IP address in our production environment. Now we have to do a similar of this JCL through rexx as we want to trap the SYSPRINT output to check if the PING was successful. Pls note that I cannot use TSO PING as my automation tool does not support OUTTRAP TSO function, so this is the only way I would be able to trap if the PING was successful. The JCL :
Code:

//STEP0A   EXEC PGM=PING,PARM='XXXXXX'
//STEPLIB  DD DISP=SHR,DSN=XXXXXX
//SYSOUT   DD SYSOUT=XXXXX
//SYSPRINT DD SYSOUT=XXXXX
//SYSTCPD  DD DISP=SHR,DSN=XXXXX

I coded the rexx doing an allocation of all DD names, but for STEPLIB it says it cannot allocate that DD name with message
Code:

 "IKJ56236I  FILE STEPLIB INVALID, FILENAME RESTRICTED".

After all allocation I call the program as :
Code:

"Ispexec Select Pgm(PING) PARM(169.165.219.101)"

and then reading the SYSPRINT as it would contain something like :
Code:

CS V1R4: Pinging host XXX.XXX.XXX
Ping #1 response took 0.002 seconds.

I then would do some processing based on the time returned.

Any help is most sought after.

Thanks for your inputs in advance.

Regards,
- Amit.
_________________
I did not fail; I have found 10,000 ways that would not work - Albert Einstein.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
amit4u79
Beginner


Joined: 24 Oct 2005
Posts: 109
Topics: 36
Location: India

PostPosted: Fri Jun 30, 2006 4:48 am    Post subject: Reply with quote

Also, the SYSPRINT data set does not contain any data. Kindly assist.
_________________
I did not fail; I have found 10,000 ways that would not work - Albert Einstein.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
amit4u79
Beginner


Joined: 24 Oct 2005
Posts: 109
Topics: 36
Location: India

PostPosted: Fri Jun 30, 2006 5:08 am    Post subject: Reply with quote

Hi All, just to add the JCL run is successful but when I use something like:

"EX 'dsnname(PING)' 'ipaddress'"

It gives me an error:

IKJ56524I COMMAND SYSTEM ERROR+
IKJ56524I IKJCT43A RETURN CODE 99

But there is no good explaination of this error message in TSO manuals.

There is no data in SYSOUT or SYSPRINT data set. Kindly assist.

Regards,
- Amit.
_________________
I did not fail; I have found 10,000 ways that would not work - Albert Einstein.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Fri Jun 30, 2006 7:01 am    Post subject: Reply with quote

amit4u79,


Why are you trying to a allocate steplib DD dynamically? You cannot dynamically allocate steplib,joblib datasets. Check this which explains the error.

Code:

IKJ56236I FILE {text} INVALID, FILENAME RESTRICTED                       
                                                                         
Explanation:  For the item text could appear the following:               
                                                                         
    text = STEPLIB                                                       
    text = USERCAT                                                       
    text = JOBLIB                                                         
    text = STEPCAT                                                       
    text = JOBCAT                                                         
                                                                         
The dynamic allocation error code is 0364. For a description of the dynamic allocation return, informational, and error codes, refer to z/OS MVS Programming: Authorized Assembler Services Guide.                     
                                                                         
Detected by:  CALLER                                                     
                                                                         
Program:  DAIRFAIL                 


and the 0364 error is

Code:
                                     
0364 - JOBLIB/STEPLIB/JOBCAT/STEPCAT specified as a ddname, or associated with specified dsname or pathname. These ddnames are  allowed only for special data sets. The accompanying message IKJ56236I identifies which of the above ddname types is in error. (dsname allocation, ddname allocation, unallocation, concatenation, deconcatenation)
                                                 
Application Programmer Action: Use a different ddname, or consult your system programmer for
the proper ddname to use.


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
amit4u79
Beginner


Joined: 24 Oct 2005
Posts: 109
Topics: 36
Location: India

PostPosted: Mon Jul 03, 2006 9:06 pm    Post subject: Reply with quote

Hi Kolusu,

As I added I have now added in the rexx to execute the program PING directly from the data set where it is residing i.e. I do a "EX 'DATASETNAME(PING)' 'IPADDRESS'".

But even then the rexx does not run fine. I knew that I could not use these DD names and so I just called the program direclty from where it is residing, which is what JCL would otherwise do. But even then as I said I am not able to get anything in the SYSPRINT data set, which otherwise when run through JCL gives something like "Ping # 1 response took...."

Pls help me as to what else needs to be done here. Am I missing anything, as I am exactly doing everything which JCL is doing i.e. do all required allocations and then execute the program PING and expect something to be written to SYSPRINT data set.

Regards,
- Amit.
_________________
I did not fail; I have found 10,000 ways that would not work - Albert Einstein.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
German Castillo
Beginner


Joined: 23 Dec 2005
Posts: 83
Topics: 2
Location: Caracas, Venezuela

PostPosted: Tue Jul 04, 2006 4:23 am    Post subject: Reply with quote

Executing directly from the load dataset is my preferred method.

Check out for messages from the program you are executing. There may even be some datasets allocated dinamically, check it out in your JOBLOG once you test it in batch. Also the same initial program may be calling another modules dinamically, and they are not in your usual search concatenation, in this case you may have a message issuing a S806 message.

However, if you happen to have several modules which you want to execute, and still be able to use the select Cmd, you can libdef your loadlib not as STEP/JOB LIB and other related ddnames for the reasons exposed above. Try to LIBDEF it to ISPLLIB or ISPLUSR instead, normal searching methods still apply, with minor execptions. All this is fully covered and detailed accordingly in the ISPF Services Guide, search for it in the manuals section.
_________________
Best wishes,

German Castillo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group