MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » October 2013

RE: un zip on iseries



fixed

Thanks Chuck,

Our V7R1 system does not yet have the required QZIPUTIL
service program nor QSYSINC header files.

However, I still lean to using the API thinking error handling
may be better ?

We have several production uses of Qp0lProcessSubtree (thanks
to Scott Klement) and these programs are reliable and easy
to copy and adapt to other uses, so my thought is the QZIPUTIL
may be a similar learning/development curve ?

(and we have the iProDeveloper article and code from Carsten Flensburg)


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Thursday, October 10, 2013 2:36 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: un zip on iseries

I know the earliest message, quoted below, was prefaced by an allusion to an avoidance of a system API... However, seems kind of silly to follow the first of the paths shown below, when the second is so much more direct, eliminating the levels of indirection and any associated difficulties from having introduced that indirection:

1> RPGpgm->QCMDshell->CLcmd->Qshell->shell_request

2> RPGpgm->QshellAPI->shell_request

I have not used that Qshell API, but FWiW:
IBM i 7.1 Information Center -> Programming -> Shells and utilities -> Qshell -> Qshell APIs http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/rzahz/rzahzapis.htm
_i QzshSystem() - Run a QSH Command i_
"...
The QzshSystem() function runs the specified shell command by spawning a child process and invoking qsh in the child process. qsh interprets and runs command and then exits.

The QzshSystem() function returns when the child process has ended.
...

_Parameters_

*command (Input) Pointer to null-terminated string that contains the shell command to run.
..."

Regards, Chuck

On 10 Oct 2013 10:55, Vernon Hamberg wrote:
<<SNIP>>
You can specify a QShell function on the QSH CL command. An example
might be if you want to put a directory listing into an IFS file.

<<SNIP>>

QShell commands can be chained - so this would create the PF, then run
the ls command into it. The semi-colon let it ignore an error like the
PF already exists. I don't remember what separator makes it stop on an
error.

qsh cmd('system "crtpf qgpl/lsout rcdlen(255)"; ls >
/qsys.lib/qgpl.lib/lsout.file/lsout.mbr')

To append to that file, use a double right-arrow.

On 10/10/2013 12:38 PM, Gary Thompson wrote:
<<SNIP>>

I do a fair amount of RPG call to QCMDEXC but never QSHELL so a
simple example would really help. <<SNIP>>

John Yeung on Thursday, October 10, 2013 10:58 AM wrote:
<<SNIP>>

Remember, anything you can do on a QSHELL or CL command line, you
can do in a CL or RPG program. (In the case of RPG, the easiest
would probably be to call QCMDEXC, which is still, for most people,
way easier than fiddling with system APIs.)


--
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.






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact