|
Also, with redirection to the traditional file system (/QSYS.LIB) the file has to exist already. The redirection won't create it. Even if you create the file in the QTEMP of your own job the unix command won't find it because they're run in "batch immediate" jobs each of which has a separate QTEMP from its own.
fbocch2595@xxxxxxx wrote:
Hi Scott, actually, I'm not able to get this pgm to work;CRTPF QTEMP/TEST RCDLEN(100)OVRDBF FILE(STDOUT) TOFILE(QTEMP/TEST) QSH CMD('echo Test Test Test')I ran all the commands manually and when I run the QSH command; QSH CMD('LS -C /PROGRAMMINGARCHIVE/* > /QSYS.LIB/QTEMP.LIB/test.FILE/test .MBR') I get msg, Command ended normally with exit status 2. Do I have to crtpf stdout in a library? -----Original Message-----From: fbocch2595@xxxxxxx To: midrange-l@xxxxxxxxxxxx Sent: Wed, 18 Oct 2006 2:22 PM Subject: Re: QSH using QTEMPOk, thanks, I'm using it now. -----Original Message-----From: midrange-l@xxxxxxxxxxxxxxxx To: midrange-l@xxxxxxxxxxxx Sent: Wed, 18 Oct 2006 2:17 PM Subject: Re: QSH using QTEMPDoes V5R4 allow ls commands to an outfile in qtemp?Every release allows ls commands to an outfile in QTEMP. But you can't do it using QShell's redirection operators, you have to use OVRDBF.You see, The QSHELL commands run in a separate, background job. If they write files directly to QTEMP, it would not be accessible to your job because there's a different copy of the QTEMP library for each job on the system. So it wouldn't do any good.However, any job can use OVRDBF to redirect STDOUT to a file. That happens in the current job, so it can direct stuff to QTEMP.For example, this will direct the output from LS to a file in QTEMP: PGM CRTPF QTEMP/DIRLIST RCDLEN(5000) OVRDBF FILE(STDOUT) TOFILE(QTEMP/DIRLIST) QSH CMD('ls -l') DLTOVR FILE(STDOUT) ENDPGM
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.