|
No reason in particular. One less parameter to pass I guess. -----Original Message----- From: michaelr_41@xxxxxxxxxxxxxx [mailto:michaelr_41@xxxxxxxxxxxxxx] Sent: Monday, May 24, 2004 11:07 AM To: Midrange Systems Technical Discussion Subject: RE: Call a command from C on as400 Why do you use system rather than QCMDEXC? On Mon, 24 May 2004 11:01:31 -0500, "Malchow, Grizzly" <GMalchow@xxxxxxxxxxxxxxxxxxxxx> said: > This is just a guess. I use the 'system' function from RPG to run OS/400 > commands. I thought that the 'system' function is a C function. I'm not > exactly sure about that though. I'm also not sure how it would work in > C. In RPG it's coded as follows: > > H BNDDIR('QC2LE') > D ExecCommand PR 10I 0 EXTPROC('system') > D Cmd * Value OPTIONS(*STRING) > > D Command S 256A > D RC S 10I 0 > > /Free > Command = 'CALL SOMELIB/SOMEPGM'; > RC = ExecCommand(Command); > /End-Free > > Maybe it would be something like this in C: > #include the necessary library > > int system (Cmd s); > char command; > int RC; > command = 'CALL SOMELIB/SOMEPGM'; > RC = system(command); > > > -----Original Message----- > From: Walt Fles [mailto:wfles@xxxxxxxxxxx] > Sent: Monday, May 24, 2004 10:30 AM > To: Midrange Systems Technical Discussion > Subject: Call a command from C on as400 > > All, > Im trying to use spawn to call a command without having to specify a > complete path, ie > without having to say "/qsys.lib/mylib.lib/mypgm.pgm" > Is there something I have to set up in my environment? > > also, how do I call from within C commands such as "dspusrprf", or do a: > "call pgm(mylib/mypgm)" from within C. I've already did a > putenv("PATH=%LIB%") > but that does not seem to help. > > I am using WDS5722 on V5R2. > > > TIA! > > > _______________________________________________ > This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing > list > To post a message email: MIDRANGE-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/midrange-l > or email: MIDRANGE-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/midrange-l. > -- michaelr_41@xxxxxxxxxxxxxx -- http://www.fastmail.fm - Same, same, but different... _______________________________________________ This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.