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

run rexx code with jcl


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

New User


Joined: 04 Feb 2024
Posts: 21
Location: united arab emirates

PostPosted: Sat Feb 10, 2024 10:02 am
Reply with quote

I want to execute rexx with jcl. but its not working. this code extract sdsf panel but jcl with this pgms ( IKJEFT1A, IKJEFT01, IKJEFT1B) is not able to execute this rexx code. Do you have any solution so that i can run this code as job.
It seems that to view the panel sdsf it is not possible to extract information from the sdsf panel with this jcl code as job.

/* REXX */
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
ADDRESS DSNREXX
'CONNECT' 'Database name'
RC = ISFCALLS('ON')
ADDRESS SDSF "ISFLOG READ TYPE(SYSLOG)"
DO I = 1 TO ISFLINE.0
IF POS('IEF125I',ISFLINE.I) \= 0 THEN DO
PARSED_DATA = SUBSTR(ISFLINE.I,POS('IEF125I',ISFLINE.I)+8,40)
SAY PARSED_DATA

END
END

jcl:

//LOGUSR JOB CLASS=A
//EREPMTN EXEC PGM=IKJEFT01,REGION=0K,PARM='LOGREAD'
//SYSEXEC DD DSN=USER.REXX,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY,BLKSIZE=80
//INDD DD *
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Sat Feb 10, 2024 10:29 am
Reply with quote

re: not able to execute

You need to provide error messages or other symptoms.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Sat Feb 10, 2024 10:34 am
Reply with quote

These are probably not required to use SDSF:
Code:
ADDRESS DSNREXX
'CONNECT' 'Database name'
Back to top
View user's profile Send private message
mox512

New User


Joined: 04 Feb 2024
Posts: 21
Location: united arab emirates

PostPosted: Sat Feb 10, 2024 10:36 am
Reply with quote

It doesn't give an error and it runs with cc0000 but it seems that it can't read the panel with this pgm.

ADDRESS DSNREXX
'CONNECT' 'Database name'

this section is connect to database for next step i need to insert in table. i think rexx code is run correctly but idont know how it run as job.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Sat Feb 10, 2024 12:33 pm
Reply with quote

Show us the trace.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Mon Feb 12, 2024 2:08 am
Reply with quote

mox512 wrote:
It doesn't give an error and it runs with cc0000 but it seems that it can't read the panel with this pgm.

ADDRESS DSNREXX
'CONNECT' 'Database name'

this section is connect to database for next step i need to insert in table. i think rexx code is run correctly but idont know how it run as job.


I don’t see any Db2 load libraries in your job step. Typically, to run a DSNREXX program you need the DB2 load libraries in your STEPLIB.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Mon Feb 12, 2024 2:09 am
Reply with quote

mox512 wrote:
It doesn't give an error and it runs with cc0000 but it seems that it can't read the panel with this pgm.

ADDRESS DSNREXX
'CONNECT' 'Database name'

this section is connect to database for next step i need to insert in table. i think rexx code is run correctly but idont know how it run as job.


I don’t see any Db2 load libraries in your job step. Typically, to run a DSNREXX program you need the DB2 load libraries in your STEPLIB.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 725
Location: Denmark

PostPosted: Mon Feb 12, 2024 3:19 am
Reply with quote

As to how to run a REXX as a job, take look at the RXINSTRX pgm at harders-jensen.com.
But I expect that at least part of your problem could be the statement 'CONNECT' 'Database name'
which I guess tries to connect to a database called DATABASE NAME. Check your quotes.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Feb 12, 2024 11:32 am
Reply with quote

re: "this section is connect to database for next step"

I agree with Willy that this is a problem. You should remove the DB2 code until you have the SDSF code working. That is, you should develop the project in incremental steps and get one to work before moving to the next so that you do not have to debug too much at once.
Back to top
View user's profile Send private message
mox512

New User


Joined: 04 Feb 2024
Posts: 21
Location: united arab emirates

PostPosted: Mon Feb 12, 2024 11:40 am
Reply with quote

I remove database connection but i cant compile my code with jcl. But it seems that this pgm or this jcl cant Execute sdsf information. if I execute this code with tso exec 'datasetname' rexx code run correctly and this information at log insert in table. But this code cant work with jcl. It seems that I can't read the sdsf panel, I am so confused.

/* REXX */

RC = ISFCALLS('ON')
ADDRESS SDSF "ISFLOG READ TYPE(SYSLOG)"
DO I = 1 TO ISFLINE.0
IF POS('IEF125I',ISFLINE.I) \= 0 THEN DO
PARSED_DATA = SUBSTR(ISFLINE.I,POS('IEF125I',ISFLINE.I)+8,40)
SAY PARSED_DATA

END
END
Back to top
View user's profile Send private message
mox512

New User


Joined: 04 Feb 2024
Posts: 21
Location: united arab emirates

PostPosted: Mon Feb 12, 2024 11:41 am
Reply with quote

I remove database connection but i cant compile my code with jcl. But it seems that this pgm or this jcl cant Execute sdsf information. if I execute this code with tso exec 'datasetname' rexx code run correctly and this information at log insert in table. But this code cant work with jcl. It seems that I can't read the sdsf panel, I am so confused.

/* REXX */

RC = ISFCALLS('ON')
ADDRESS SDSF "ISFLOG READ TYPE(SYSLOG)"
DO I = 1 TO ISFLINE.0
IF POS('IEF125I',ISFLINE.I) \= 0 THEN DO
PARSED_DATA = SUBSTR(ISFLINE.I,POS('IEF125I',ISFLINE.I)+8,40)
SAY PARSED_DATA

END
END
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2120
Location: USA

PostPosted: Mon Feb 12, 2024 6:28 pm
Reply with quote

mox512 wrote:
i cant compile my code with jcl


1. First of all, please learn how to use the Code button to present your information to others.

2. There is no need to "compile any REXX code with JCL". This phrase is just bullshit, pardon my French. Please, find out for yourself: what are you actually doing?

3. If you want to get any useful response from the Forum, you MUST present here all detailed information, with copies of logs, and/or error messages, and/or correct/incorrect output data, etc. etc. etc.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10879
Location: italy

PostPosted: Mon Feb 12, 2024 6:42 pm
Reply with quote

from the first TS post...

Quote:
I want to execute rexx with jcl


to use SDSF, ISPF functions in rexx you will need a FULL ISPF environment

see here for the details

www.ibm.com/docs/en/zos/3.1.0?topic=guide-using-sdsf-in-batch

to have available the DB2 function look at the documentation/manuals for db2
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Feb 13, 2024 11:23 am
Reply with quote

I would make sure you get a response:

Code:

If isfline.0 > 0 Then
  DO I = 1 TO ISFLINE.0
   . . .
 
  END
Else
  Say 'no response'
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Feb 13, 2024 11:26 am
Reply with quote

re: "i think rexx code is run correctly"

Can you run your rexx code from your TSO id? I suggest you try that, assuming that you can use SDSF from there, to show that SDSF is setup correctly.

If it works in TSO, check your DD allocations for some ISF files... they also need to be allocated in your batch job.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Feb 13, 2024 11:30 am
Reply with quote

Show us the trace.

And look here for more debugging information:
www.ibm.com/docs/en/zos/3.1.0?topic=language-diagnosing-errors-in-rexx-exec
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 Help needed in automation cics transa... CLIST & REXX 1
No new posts Reroute print output via REXX/SDSF TSO/ISPF 6
No new posts Get RECORD LENGTH, allocated space of... CLIST & REXX 7
No new posts SDSF and Rexx TSO/ISPF 4
No new posts Compare 2 alphabets in a REXX and fin... CLIST & REXX 2
Search our Forums:

Back to Top