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

How to pass the PARM value to my target program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
@shim

New User


Joined: 28 Oct 2021
Posts: 10
Location: India

PostPosted: Mon Aug 21, 2023 9:42 pm
Reply with quote

Hello,

I have a vendor program which generally runs as a batch program with EXEC PGM=xxxx,PARM=(xxx). For some specific requirement, I am calling this program through a COBOL program after creating a dynamic TSO environment through IKJTSOEV and allocate all the required files by using TSO ALLOC and pass the control through CALL *(xxxxx). This runs fine. But there are some control paameters which is sent through the PARM. I am not able to figure out how to pass this parms to the target program. Could you please share any direction or advice which I can explore further? Thanks for your guidance in advance.

Regards,
AP
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Aug 21, 2023 10:48 pm
Reply with quote

re: generally runs as a batch program with EXEC PGM=xxxx,PARM=(yyy)

I think you use the TSO CALL command:
Code:
Addres TSO "CALL *(xxxx)  yyy"
Back to top
View user's profile Send private message
@shim

New User


Joined: 28 Oct 2021
Posts: 10
Location: India

PostPosted: Tue Aug 22, 2023 9:18 am
Reply with quote

Pedro wrote:
re: generally runs as a batch program with EXEC PGM=xxxx,PARM=(yyy)

I think you use the TSO CALL command:
Code:
Addres TSO "CALL *(xxxx)  yyy"



Thank you Pedro. I will test this as per your suggestion.

Regards,
AP
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Aug 22, 2023 11:03 am
Reply with quote

I have not done it for some time, if it does not work try also using single quotes:
Code:
Address TSO "CALL *(xxxx) 'yyy'"
Back to top
View user's profile Send private message
@shim

New User


Joined: 28 Oct 2021
Posts: 10
Location: India

PostPosted: Thu Aug 24, 2023 3:04 pm
Reply with quote

Pedro wrote:
I have not done it for some time, if it does not work try also using single quotes:
Code:
Address TSO "CALL *(xxxx) 'yyy'"


Just to update and thanks Pedro it works fine with single quotes.

Regards,
AP
Back to top
View user's profile Send private message
@shim

New User


Joined: 28 Oct 2021
Posts: 10
Location: India

PostPosted: Tue Oct 03, 2023 5:12 pm
Reply with quote

This is in continuation with the above post related with CALLing a program through IKJEFSTR. My program running as a Started Task --> CALLs Another Vendor Program (Authorized) which in turns invokes another vendor program (Not Authorized). I added the first level program in AUTHPGM (tried after adding with AUTHTSF section also). While the second level program gets controlled, it gives a S047 APF auth error. All the STEPLIB concatenations are APF auth. But interestingly, if I invoke the same program with REXX ADDRESS TSO with all the same LOADLIBs, it runs fine. It seems with IKJEFSTR and second level vendor program together has some issues.

I am thinking now to make it through REXX. If you can advise whether implementing a long running task through REXX in production environment is recommended or not. The REXX program will not do any FILE IO, it will retrieve rows of a DB2 table and pass the parameters to the Vendor program through CALL macro which will do all the work. Any comments on this approach is greatly appreciated. Thanks in advance !!
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed Oct 04, 2023 12:27 am
Reply with quote

Presumably, you meant IKJEFTSR.

From your explanation, it is not clear who is calling who. But in general, a program that is not authorized cannot call an authorized program because of reasons. It is in that situation where the non-authorized program uses IKJEFTSR to call the authorized program.

And the situation is complicated because you say they are vendor programs and frequently you are not given the source.

You did not indicate the status, but the authorized program needs to be link edited with AC(1).
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed Oct 04, 2023 12:32 am
Reply with quote

You might be able to use ATTACH macro to invoke the authorized program. ATTACH creates a different TCB and, IIRC, should ignore the callers APF status.

non-auth program:
1. ATTACH for MYAUTH1
2. WAIT on ECB

MYAUTH1:
1. do the work
2. POST ECB
Back to top
View user's profile Send private message
@shim

New User


Joined: 28 Oct 2021
Posts: 10
Location: India

PostPosted: Wed Oct 04, 2023 12:16 pm
Reply with quote

Thanks Pedro for the inputs. Yes it is somewhat complicated as we don't have the source of the Vendor programs. Finally I have been calling IKJEFT01 which in turn invoking the same CALL command as IKJEFSTR.

I had to make my program authorized and added the first level vendor program in AUTHPGM. With this the second level program which was giving S047 previously does not complain any more.

Thanks Again for all the help and directions!!

Regards,
Ashim
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Is this possible via sort (in one pass)? SYNCSORT 4
No new posts System add a USER parm when job submi... TSO/ISPF 4
No new posts Error to invoke MPP program through B... IMS DB/DC 3
No new posts Using API Gateway from CICS program CICS 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
Search our Forums:

Back to Top