Help,
okay, i have a program which in somecase will call another external c++ program,
i just dont know how to do this.
Both of my program are in my CHRISM.LOADLIB (my user)
reading the zos manuals, system() should do the job. there are two different ways i can format the system() command
sprintf(line,"PGM=PROGRAM2,PARM='%s'",Passed);
rc = system(line);
sprintf(line,"PROGRAM2 %s",Passed);
rc = system(line);
do i need to put something in the JCL, or do i need to do a program linkage
extern "REFERENCE" {
void PROGRAM2(char *);
}
Any help would be good.
Many thxs
Calling external executable program
-
- Posts: 20
- Joined: Tue Jul 31, 2007 7:16 pm
- Skillset: C++
Rexx - Referer: Lookin for help google
- Contact:
Re: Calling external executable program
Dont worry everyone, i have done it myself
i used system(), but i used
"call 'prefix.program' 'arg1' 'arg2' 'arg3'
and so on.
'prefix.program'
can also be 'prefix.dataset(program)'
a thread with only me

i used system(), but i used
"call 'prefix.program' 'arg1' 'arg2' 'arg3'
and so on.
'prefix.program'
can also be 'prefix.dataset(program)'
a thread with only me

Re: Calling external executable program
Thanks for reposting the answer, it sure had me stumped.......
-
- Posts: 20
- Joined: Tue Jul 31, 2007 7:16 pm
- Skillset: C++
Rexx - Referer: Lookin for help google
- Contact:
Re: Calling external executable program
it was in the C/C++ programming guide for zos v1r6.0
under redirecting streams under zos, just really luck i found it
under redirecting streams under zos, just really luck i found it
-
- Posts: 20
- Joined: Tue Jul 31, 2007 7:16 pm
- Skillset: C++
Rexx - Referer: Lookin for help google
- Contact:
Re: Calling external executable program
Spoke 2 soon,
it allows me to use this to call from ispf command shell, but not if i pass it 2 system()
so any help would be nice
it allows me to use this to call from ispf command shell, but not if i pass it 2 system()
so any help would be nice
-
- Posts: 20
- Joined: Tue Jul 31, 2007 7:16 pm
- Skillset: C++
Rexx - Referer: Lookin for help google
- Contact:
Re: Calling external executable program
This is drivin me mad,
y is it so difficult, to run a program from another
y is it so difficult, to run a program from another
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Calling external executable program
Hello,
What error are you getting?
What resources are available to the "shell" that are not available to the run with problems? I suspect there may be one or more datasets missing from the batch run?

I suspect that it is not difficult once you know how. . .y is it so difficult, to run a program from another
What error are you getting?
What resources are available to the "shell" that are not available to the run with problems? I suspect there may be one or more datasets missing from the batch run?
I do not understand what this meansbut not if i pass it 2 system()

Hope this helps,
d.sch.
d.sch.
-
- Posts: 20
- Joined: Tue Jul 31, 2007 7:16 pm
- Skillset: C++
Rexx - Referer: Lookin for help google
- Contact:
Re: Calling external executable program
i found the problem,
this will work normal but
my environment i am using. i am using one of the adcd from ibm
with posix(ON) so the system() doesnt pass the command to the tso shell, but it passes it to the unix shell so it fails
this will work normal but
my environment i am using. i am using one of the adcd from ibm
with posix(ON) so the system() doesnt pass the command to the tso shell, but it passes it to the unix shell so it fails
-
- Posts: 20
- Joined: Tue Jul 31, 2007 7:16 pm
- Skillset: C++
Rexx - Referer: Lookin for help google
- Contact:
Re: Calling external executable program
this should work "call 'prefix.program' 'arg1' 'arg2' 'arg3'
and so on.
'prefix.program'
can also be 'prefix.dataset(program)'
and so on.
'prefix.program'
can also be 'prefix.dataset(program)'
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Calling external executable program
Thank you for posting your solution
d

d