View previous topic :: View next topic
|
Author |
Message |
kenshin
New User
Joined: 02 Aug 2014 Posts: 16 Location: Saint Paul , USA
|
|
|
|
Can anyone please help me in executing CA 7 commands through REXX
The code which I am using currently does not work and always ends with RC 8.
COMMAND = 'LQ,JOB='myjobname
RSLT = CAL2X2WA()
SAY RSLT
IF RSLT <> 'SUCCESS'
THEN EXIT_RC = 20
ELSE DO
ADDRESS CA7 COMMAND
EXITRC = RC
END
I get 'SUCCESS' message in RSLT but RC is always 8
[/b] |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
what happens when You run the script using Trace ? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
I Googled ca-7 rexx and got back about 77,800 hits and the very first one was titled CA7MVS - Sample CA-7 Interface Routine. This page says:
Quote: |
CA7MVS -- Sample CA 7 Interface Routine
Last update October 31, 2014
Contents
•CA7MVS Implementation
•CA7MVS Customization Variables
The routine CA7MVS in the REXX library (data set SYS1.OPS.CCLXEXEC) is an OPS/REXX program that issues CA 7 commands and gets responses returned in the external data queue of the calling program.
•This syntax issues the CA 7 LACT command:
CALL CA7MVS 'LACT|EXECUTE'
◦Vertical bar |
The default command separator. Editing the CA7MVS separator parameter can modify the default command separator.
◦EXECUTE command
The equivalent of pressing the Enter key. A simple DO WHILE QUEUED() loop can process the returned response lines.
•To enter data on a multiple field screen, you can input using the split vertical bar.
For example, This syntax places the command PF in the first (top) input field, the command I20 in the second input field, and then presses the Enter key (EXECUTE command):
CALL CA7MVS 'PF|I20|EXECUTE'
•You can make multiple calls to CA7MVS and cause input to be stacked until you call CA7MVS with the EXECUTE command. The previous example could have been written:
CALL CA7MVS 'PF'
CALL CA7MVS 'I20'
CALL CA7MVS 'EXECUTE'
or
CALL CA7MVS 'PF|I20'
CALL CA7MVS 'EXECUTE'
or
CALL CA7MVS 'PF'
CALL CA7MVS 'I20|EXECUTE'
By default, EXECUTE presses the Enter key, which can be overridden by specifying a PF key or other attention key (PF1, ..., PF24, PA1, PA2, PA3, CLEAR, or Enter). For example:
CALL CA7MVS 'EXECUTE CLEAR'
CALL CA7MVS 'LACT|EXECUTE ENTER'
CA7MVS Implementation
The CA7MVS REXX program uses the ADDRESS EPI environment to define a virtual terminal, enable it, and log it on to CA 7. When a user wants to execute a sequence of input commands, they are stacked in global variables (uniquely named for each address space) until an EXECUTE command is encountered.
The CA 7 virtual terminal is then enqueued on exclusively, and the input data is entered onto the screen. Responses are scrolled through to retrieve all output and are placed in the REXX external data queue. The virtual terminal is dequeued after completion.
The CA7MVS program handles scrollable output such as that from LACT, LPRRN, LJOB, and most other list commands (Lxxx) in a special way, as follows:
•All blank lines are removed.
•Page number lines are removed.
•Duplicate column header lines are removed from page 2 and all subsequent pages.
This causes the returned output to start with a single set of column header lines, followed by detail data lines without intervening headers or blank lines, followed optionally by a command completion line from CA 7.
The intended use for the CA7MVS is primarily for command/response type applications, where a single command is used to inquire CA 7 (non-interactive commands). Commands that invoke an interactive dialog (such as QJCL) can be issued through CA7MVS, but will leave the terminal unusable for other callers of CA7MVS in that case.
The CA7MVS program does allow multiple users to issue non-interactive commands using a single CA 7 virtual terminal. CA7MVS takes care of the details of sharing the virtual terminal in such case. |
Perhaps, rather than posting on a forum, you should go to the CA support web site (which you have access to if your site pays for CA-7) and see what documentation CA provides? |
|
Back to top |
|
|
kenshin
New User
Joined: 02 Aug 2014 Posts: 16 Location: Saint Paul , USA
|
|
|
|
yes I tried running the script with 'trace' but did not get any useful messages:
SUCCESS
8 *-* IF RSLT <> 'SUCCESS'
10 *-* ELSE
*-* DO
11 *-* ADDRESS CA7 COMMAND
>>> "LQ,JOB=IA6067D"
12 *-* EXITRC = RC
13 *-* SAY 'EXITRC' EXITRC
EXITRC 8
I am curious to know that if CAL2X2WA() utility is working perfectly fine in my program then there should be a method defined somewhere in the CA documents to invoke CA7 commands .
I wonder if any of the CA 7 commands can be executed through JCL.. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
did you try:
Code: |
COMMAND = 'LQ,JOB='myjobname
RSLT = CAL2X2WA(command)
|
? |
|
Back to top |
|
|
kenshin
New User
Joined: 02 Aug 2014 Posts: 16 Location: Saint Paul , USA
|
|
|
|
COMMAND = 'LQ,JOB='myjobname
RSLT = CAL2X2WA(COMMAND)
SAY RSLT
IF RSLT <> 'SUCCESS'
THEN EXITRC = 20
ELSE DO
ADDRESS CA7 COMMAND
EXITRC = RC
SAY 'EXITRC' EXITRC
END
I tried but results were the same, I got EXITRC = 8 ,no matter what commands I use in 'COMMAND' , Its strange , I get success message but RC 8 .
I am not sure if any additional setting needs to be done to invoke CA7 through REXX,
Did anyone tried execute the same code and worked on their system? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
I am not sure what is confusing. You are issuing two different commands. The first is 'success', the second gets return code 8:
Code: |
RSLT = CAL2X2WA(COMMAND)
SAY RSLT |
and later
Code: |
ADDRESS CA7 COMMAND
EXITRC = RC
SAY 'EXITRC' EXITRC |
Sorry, I do not familiar with CA products. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Does the CA-7 interface provide special variables with the error message number and text? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
You are issuing two different commands. |
My point was: if the first is successful, do you need to issue the second one? |
|
Back to top |
|
|
kenshin
New User
Joined: 02 Aug 2014 Posts: 16 Location: Saint Paul , USA
|
|
|
|
Code: |
COMMAND = 'LJOB,JOB='myjobname
RSLT = CAL2X2WA(COMMAND)
SAY RSLT
|
Pedro, Yes you are right, I deleted the second part .
so my RSLT gives 'SUCCESS' message , does it mean that my code has successfully connected to CA 7 ?
Could you please help me in extracting results of job execution in REXX?
I goggled and found a below code but I don't think that it will solve my purpose.
Code: |
DO I = 1 TO CCIMSG.0
PULL CCIMSG.I
CCIMSG.I = SUBSTR(CCIMSG.I,2)
SAY CCIMSG.I
END |
|
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Instead of "goggling" why not read the fount of all relevant knowledge - the manual. It will tell you what is returned. |
|
Back to top |
|
|
|