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



Ok I am just going with using the system API and the MOV command. It
works. I was just hoping to find the API / Program behind the command
so I would not be adding that additional workload. Guess it just is not
worth the effort as all the APIs I have found don't seem to move between
servers.



Chris Bipes
Director of Information Services
CrossCheck, Inc.


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Thursday, November 12, 2009 11:54 AM
To: Midrange Systems Technical Discussion
Subject: Re: opendir() - THE ANSWER

Vern,

This is a bad idea. The programs in the QSHELL library are meant to be
used inside the QShell environment.

There are all sorts of things that are set up in that environment...
this includes the standard I/O streams being set up a particular way,
certain environment variables being set up a particular way, certain
descriptor set up, the services of a shell and all of the stuff that the

shell does for you, being spawned a separate child job, etc.

These programs are written with the expectation that they will have all
of that stuff set up. If you call the programs directly, you are using
them in a manner that they weren't intended to be used!

If they happen to work because they don't happen to require the QShell
environment right now... well, okay, I guess they'll work then. But you

can't rely on that being the case going forward. Your app may work
today, then you might do a release upgrade or install a PTF and it may
stop working.

It's just not a good idea to use software in a manner that it wasn't
intended for!

If you're really THAT hard-up for a MV utility, you'd be better off
finding an open source one and taking the relevant pieces of code out of

it so you can use it on i.

But I really don't see the value in calling the QShell MV command here.
why not just use the CL MOV command? That'll be more efficient than
the Qshell variety, and you'll be using it from the interface it was
deisgned for.

Just write a simple little wrapper program like this:

PGM PARM(&FROM &TO)
DCL VAR(&FROM) TYPE(*CHAR) LEN(500)
DCL VAR(&TO) TYPE(*CHAR) LEN(500)
MOV OBJ(&FROM) TOOBJ(&TO)
ENDPGM

Compile that as a CL program (or if you prefer, as a CL module and bind
it to your RPG) then you can call it willy-nilly.



Vern Hamberg wrote:
Every command in QShell is a symbolic link to a program - those
programs
handle parameters the way a C program does - in my experience. There
is
a MV command in QShell, and its program is QSHELL/MV. This is an
example
of using it that does just what you want -

call QSHELL/MV ('/home/vern/aab.txt' '/home/aab.txt')

Scott, here's a chance for another article!!

I figured this out about 6 years ago and had forgot it. If you want it

not to prompt when replacing, add a parameter with value '-f'.

Whoopee!!
Vern

Chris Bipes wrote:
Not so crazy.. But how to write records to a iSeries Database from
within that shell script? Then make it wake up an process the
directory
until empty every few minutes. We receive images from our customers,
thousands a day, and move them from our FTP and WEB servers,
currently
to a windows 2003 server. Our problem has been finding images when
we
have too many files in one directory. This is why we are building a
database as the images come in, move them to our NAS which we have
mounted an empty IFS directory over. Then we can search the database
to
find the image and know exactly where it is.



Chris Bipes
Director of Information Services
CrossCheck, Inc.


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Vern Hamberg
Sent: Thursday, November 12, 2009 9:24 AM
To: Midrange Systems Technical Discussion
Subject: Re: opendir()

Chris

Here's a crazy idea - write a shell script and run it in PASE!




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.