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

attachpgm vs call


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

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Mon Apr 25, 2016 11:29 am
Reply with quote

In one of my execs I use

Code:
address attchpgm "dsntiar sqlca tiar_msg text_len"

and if the system is IPL'ed with a loadparm that sets up a system where DB2 is running, everything is hunky-dory, and the code works as expected.

However, if I IPL with a loadparm that does not start DB2, REXX returns a RC = -3. So I thought, why not change it to

Code:
"call 'dsn910.sdsnload(dsntiar)'" sqlca tiar_msg text_len

but no matter what or how I quote in the parameters, I cannot get it to work, getting messages about invalid keywords.

Does anyone know how to actually get it to work?
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Mon Apr 25, 2016 12:22 pm
Reply with quote

Additional, trying to use it like

Code:
"ispexec libdef ispllib dataset id('dsn910.sdsnload') stack"
"ispexec select pgm(dsntiar) parm("sqlca","tiar_msg","text_len")"
"ispexec libdef ispllib"

Gives me a S0C4 and on occasion an ISPF main task abend, throwing me back to the READY prompt. icon_sad.gif
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Mon Apr 25, 2016 1:10 pm
Reply with quote

I believe you need to have your DB2 up and running no matter what...
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 Apr 25, 2016 5:52 pm
Reply with quote

I just ran a test, and it appears that DSNTIAR requires an active DB2 connection in order to function properly.

For what it is worth I call DSNTIAR from rexx using my RXSQLCA program www.idug.org/p/fo/et/thread=23897
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Apr 25, 2016 9:35 pm
Reply with quote

For:
Code:

address attchpgm "dsntiar sqlca tiar_msg text_len"

I recall that the parameters are variable names. Rexx will resolve the values of the variables before attaching the specified module name.

But the syntax for CALL is different. The parameter list needs to be enclosed in single quotes. Maybe something like this:
Code:
"call 'dsn910.sdsnload(dsntiar)'   '"|| sqlca tiar_msg text_len || "'"

Though, if any of those variables include single quotes, you need to double them up.

re: "getting messages about invalid keywords"
Can you provide the message? Are they TSO messages or DB2 messages?
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Mon Apr 25, 2016 10:36 pm
Reply with quote

Just curious, what is the point for DSNTIAR without DB2 being active? or Am I missing anything here?
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Apr 26, 2016 12:51 am
Reply with quote

Quote:
or Am I missing anything here?

I thought Prino was reporting that the CALL command was not working as expected.
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 Error while running web tool kit REXX... CLIST & REXX 5
No new posts Call program, directly from panel CLIST & REXX 9
No new posts Batch call online program, EXCI task ... CICS 3
No new posts CSQBGET - Call giving completion code... COBOL Programming 3
No new posts CICS DPL call CICS 6
Search our Forums:

Back to Top