× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Alan,

Glad you figured this out -- btw, this is a very common problem for people running QShell in batch environments -- always the first thing you should check when QSh works interactively, but not in batch.

I would also add that I recommend using Rfile if you want to read/write native files. That's not related to the problem you had here today, but... I've seen weird results (though, at the moment, I don't remember precisely what they were) when using the > or >> redirect to write to PF members.

Instead, consider using Rfile.

QSH CMD('ls | Rfile -wQ yourlib/yourfile')

The QShell Rfile command is designed for reading/writing record-based files. (Normal redirects work great with stream files, though.)

-SK



On 11/13/2012 3:34 PM, Alan Shore wrote:
ANSWER TO PROBLEM FOUND
I cannot write that in TOO LARGE a font.
The problem has NOTHING to do with the ifs directory, the file that I am attempting to capture the output to OR the authority.
It was the number of jobs allocated to the sub-system.
Like I said in a prior e-mail, the job has been running okay for a couple of weeks, then all of a sudden, it had problems.
That's because at approximately 8:50 this morning another job in the same subsystem went into a MSGW status (this is the development system so these can be around for a while).
Once it FINALLY dawned on me what the problem could be, I had systems increase the number of jobs in that subsystem and bingo-gringo, the problem went away.
This also explains why running the same command in QSH also worked.
Now I am wondering why the message was QSH0005 with return code of 2
Man - now I am mentally beat
Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Shore
Sent: Tuesday, November 13, 2012 4:08 PM
To: Midrange Systems Technical Discussion
Subject: RE: Problem with QSH command that is sending me UP the wall

Hi Rob
At the moment if I said that 2 + 2 =4 and you replied that it wasn't, I'm pretty sure that I would doubt my original answer.
In other words, I'm not too sure.
The best way that I think I can answer that, is by repeating what I had originally written.

Using STRDBG on the CL program I have determined the &LSCOMMAND contains the following value

ls /weborders/HB*.txt >/qsys.lib/hbmofa.lib/webordifs.file/webordifs.mbr

Copying and pasting this text into the QSH command and pressing Enter results in the file HBMOFA/WEBORDIFS being populated with the following records (***NOTE*** I made sure that the file was empty BEFORE the QSH command was given:-

Record# ....5...10...15...20...25...30.
1 /weborders/HB1000001860.txt
2 /weborders/HB1000001870.txt
3 /weborders/HB1000001880.txt
4 /weborders/HB1000001890.txt
5 /weborders/HB1000001930.txt
6 /weborders/HB1000001940.txt
7 /weborders/HB1000001950.txt
8 /weborders/HB1000002030.txt
9 /weborders/HB1000002040.txt
10 /weborders/HB1000002050.txt
11 /weborders/HB1000002060.txt
12 /weborders/HB1000003210.txt


Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Tuesday, November 13, 2012 3:55 PM
To: Midrange Systems Technical Discussion
Subject: RE: Problem with QSH command that is sending me UP the wall

Are you sure that it IS pointing to the directory that you are trying to interrogate, and not the qsys.lib directory you are writing to?


Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: Alan Shore <ashore@xxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>,
Date: 11/13/2012 03:40 PM
Subject: RE: Problem with QSH command that is sending me UP the
wall
Sent by: midrange-l-bounces@xxxxxxxxxxxx



Thanks for your reply Mark
I will definitely keep that in mind, but if the QWSH0005 reason code 2 is
pointing to the ifs directory that I am trying to interrogate, then I
don't think that redirecting the output to a different file will get me a
different result

Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [
mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark S Waterbury
Sent: Tuesday, November 13, 2012 3:34 PM
To: Midrange Systems Technical Discussion
Subject: Re: Problem with QSH command that is sending me UP the wall

Hi, Alan:

Why not run your Qsh "ls" command and redirect the output to a true IFS
file, e.g. in "/tmp", then, returning to your CL program, you can use the
CPYFRMSTMF command to copy that file to your physical file member ... and
CPYFRMSTMF supports MBROPT(*ADD) or MBROPT(*REPLACE) ...

HTH,

Mark S. Waterbury

> On 11/13/2012 3:12 PM, Alan Shore wrote:
Thanks for the reply Rob
If my coding had never worked, I would probably go with the Scott
Klement type of IFS handling, but it HAS been working (I know -
obstinate so and so - that's me) And now that its NOT working now, I'm not
too sure ifs auditing will help.

Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Tuesday, November 13, 2012 3:07 PM
To: Midrange Systems Technical Discussion
Subject: RE: Problem with QSH command that is sending me UP the wall

shot from the hip: IFS auditing?

or rewrite to some Scott Klement type of IFS handling to do it
piece-by-piece. :-(


Rob Berendt

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


Disclaimer: This message contains confidential information and is intended
only for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please notify the
sender immediately by e-mail if you have received this e-mail by mistake
and delete this e-mail from your system. E-mail transmission cannot be
guaranteed to be secure or error-free as information could be intercepted,
corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.
The sender therefore does not accept liability for any errors or omissions
in the contents of this message, which arise as a result of e-mail
transmission. If verification is required please request a hard-copy
version. Any views or opinions presented are solely those of the author
and do not necessarily represent those of the company.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.