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

How to execute CICS commands in REXX?


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

New User


Joined: 16 Mar 2015
Posts: 8
Location: Chennai

PostPosted: Mon Apr 27, 2015 9:45 am
Reply with quote

Hi everyone,

I have started learning REXX programming. I want to execute a CICS command in REXX like

"CICS ASKTIME ABSTIME(VAR)"

I have written a small code for this and on executing that code I am getting return code = -3.

/*REXX*/
ADDRESS CICS
ARG WS_TIME
"CICS ASKTIME ABSTIME(WS_TIME)"
IF RC<>0 THEN
SAY 'ERROR READING RC='RC
ELSE
DO
PARSE WS_TIME
SAY 'TIME IS: ' WS_TIME
END
EXIT


Please give me a solution to solve this issue.

Thanks in advance.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Apr 27, 2015 11:09 am
Reply with quote

Quote:
have written a small code for this and on executing that code I am getting return code = -3.


running under TSO the CICS command environment is not available.

You should run the script while being connected to CICS
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Apr 27, 2015 8:22 pm
Reply with quote

... or you could use the TIME function, native to rexx ...
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Apr 27, 2015 9:43 pm
Reply with quote

I have never used CICS, so can not help too much. But it is unlikely that you can just one day decide that you want to start playing with CICS. You likely will need some permissions given to do so.
Back to top
View user's profile Send private message
nilaksh92

New User


Joined: 16 Mar 2015
Posts: 8
Location: Chennai

PostPosted: Tue Apr 28, 2015 11:05 am
Reply with quote

Marso wrote:
... or you could use the TIME function, native to rexx ...



Yeah, I know their is a TIME() function in REXX but I want to execute some CICS commands in REXX.

But I am not able execute any single command of CICS in REXX.

Please help me to solve this issue.

Thanks in advance.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Apr 28, 2015 12:04 pm
Reply with quote

what is that You did not understand in my first reply ?
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: Tue Apr 28, 2015 5:46 pm
Reply with quote

Quote:
I want to execute some CICS commands in REXX.
Let's be clear -- if you want to do this, you MUST be running your REXX in a CICS region, or you must connect to a CICS region before you can run any CICS commands in REXX.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Apr 28, 2015 7:13 pm
Reply with quote

Can you give details about how you are executing your rexx program?
Back to top
View user's profile Send private message
nilaksh92

New User


Joined: 16 Mar 2015
Posts: 8
Location: Chennai

PostPosted: Thu Apr 30, 2015 12:32 pm
Reply with quote

Hi Friends,

My code is working now.

/*REXX*/
ADDRESS REXXCICS
ARG WS
"CICS ASKTIME ABSTIME(WS)"
"CICS FORMATTIME ABSTIME(WS) DDMMYYYY(WS_DATE) TIME(WS_TIME)"
SAY WS_DATE
SAY WS_TIME
SAY "RC :"RC
EXIT


I wrote this program in CICS region.

Thanks to all for help.

One more query "Where I can see description of return codes of REXX for CICS environment"

I am getting rc=-521 and rc=-522 for two different programs.


Thanks in advance
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Apr 30, 2015 8:17 pm
Reply with quote

Please start a new topic for a new question.

The answer is, probably, one of the manuals for the language in use.
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 Apr 30, 2015 10:59 pm
Reply with quote

The REXX for CICS Transaction Server 5.2 Reference manual has a chapter on return codes:
Quote:
-521
Command not supported
-522
Invalid command or keyword

Are you running your REXX in CICS? If not, how are you telling REXX which of the various CICS regions defined on your site to connect to?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Fri May 01, 2015 11:28 am
Reply with quote

Quote:
I wrote this program in CICS region.
Back to top
View user's profile Send private message
nilaksh92

New User


Joined: 16 Mar 2015
Posts: 8
Location: Chennai

PostPosted: Mon May 04, 2015 10:58 am
Reply with quote

Robert Sample wrote:
The REXX for CICS Transaction Server 5.2 Reference manual has a chapter on return codes:
Quote:
-521
Command not supported
-522
Invalid command or keyword

Are you running your REXX in CICS? If not, how are you telling REXX which of the various CICS regions defined on your site to connect to?



I have written this program in CICS region still I am getting this error.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon May 04, 2015 4:33 pm
Reply with quote

How about putting a trace into your program and check return codes? You give us absolutely no clue as to which 'command' is giving which return code. You do not even give the full error messages.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Tue May 05, 2015 12:07 pm
Reply with quote

I don't see your commands here :

www-01.ibm.com/support/knowledgecenter/SSGMCP_5.2.0/com.ibm.cics.rexx.doc/topics/commref.html
Back to top
View user's profile Send private message
nilaksh92

New User


Joined: 16 Mar 2015
Posts: 8
Location: Chennai

PostPosted: Tue May 05, 2015 12:51 pm
Reply with quote

Nic Clouston wrote:
How about putting a trace into your program and check return codes? You give us absolutely no clue as to which 'command' is giving which return code. You do not even give the full error messages.



PROGRAM

/*REXX*/
ADDRESS REXXCICS
'CICS CEDA INSTALL GROUP(DUDE)'
SAY "RC,"RC
EXIT


ERROR

3 *-* 'CICS CEDA INSTALL GROUP(DUDE)'
+++ RC(-522) +++
RC,-522

This is my program and output what I am getting on executing this program.

Thanks in advance.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue May 05, 2015 6:16 pm
Reply with quote

Can you give details about how you are executing your rexx program?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue May 05, 2015 7:35 pm
Reply with quote

psychic day is tomorrow ...

today I can just give a wild guess

Code:
CICS CEDA INSTALL GROUP(DUDE)


do You have the authority to do that ?
Back to top
View user's profile Send private message
nilaksh92

New User


Joined: 16 Mar 2015
Posts: 8
Location: Chennai

PostPosted: Wed May 06, 2015 9:56 am
Reply with quote

enrico-sorichetti wrote:
psychic day is tomorrow ...

today I can just give a wild guess

Code:
CICS CEDA INSTALL GROUP(DUDE)


do You have the authority to do that ?


Yeah, I have authority to do the same.
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Using API Gateway from CICS program CICS 0
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
Search our Forums:

Back to Top