On Fri, Jun 6, 2014 at 12:09 PM, Paul Gilmartin < [email protected]> wrote:
> On Fri, 6 Jun 2014 09:25:09 -0700, Sri h Kolusu wrote: > > >John, > > > >Not exactly a SORT Verb interface, but you CAN call both DFSORT and > >ICETOOL from C and C++ programs. The key is to use the system() function > >in the C/C++ program and supply the needed JCL and control statements when > >you execute the program. Check out the smart DFSORT Trick "C/C++ calls to > >DFSORT and ICETOOL" at > > > >http://www.ibm.com/support/docview.wss?uid=isg3T7000094 > > > "JCL"? I thought that system() runs a POSIX shell. But I suppose that > shell could use the submit utility to submit batch JCL. > That's what I thought too. It turns out that on z/OS, system() has two modes: POSIX(ON) and ANSI (or POSIX(OFF)) mode. In POSIX(ON) it works like a UNIX person would expect, running UNIX programs or shell scripts by doing a spawn() of "/bin/sh" to run the argument command. But in ANSI mode, the system() uses a z/OS LINK macro to run the specified program, with an optional PARM which is like the JCL EXEC PARM=. Apparently the ANSI form of system() runs the LINK'ed to program in the same address space as the caller. ref: http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/EDCLB1C0/3.1001.3 > > -- gil > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN > -- There is nothing more pleasant than traveling and meeting new people! Genghis Khan Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
