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



Scott

Thanks - I wonder if this creates the file when it doesn't already exist - that was the main issue I ran into with redirects. The other was that the PF had to be either a flat or source file.

Just tried it on a V5R3 machine - Rfile was introduced at that release - the pipe didn't work - the results were displayed to stdout. Will look at this more, I like being able to use library naming with the -Q option.

Just to muddy the waters - had a crazy thought - a user space could be used - using path naming, it gets treated exactly like a stream file - I just tried this - it creates the space if not already there, and each entry has x'25' after it.

QSH CMD('ls -A1 / > /qsys.lib/vhamberg1.lib/myspace.usrspc')

The DSPF command shows the contents -

dspf '/qsys.lib/vhamberg1.lib/myspace.usrspc'

Hex display of DSPF looks like this -

405C5C5C 5C5C5C5C 5C5C5C5C 5CC28587 89959589 ************Beginni
C3878984 85A5C5A7 A3C8A394 9325 CgidevExtHtml
D8C4D3E2 25 QDLS
D8C6D7D5 E6E2E2E3 C725 QFPNWSSTG
D8C68993 85E2A599 4BF4F0F0 25 QFileSvr.400
D8C9C2D4 25 QIBM
D8D5E3C3 25 QNTC
D8D6D7E3 25 QOPT
D8D69785 95E2A8A2 25 QOpenSys
D8E2D925 QSR
D8E2E8E2 4BD3C9C2 25 QSYS.LIB
D8E3C3D7 E3D4D425 QTCPTMM
82899525 bin
83878984 85A5F225 cgidev2
83878986 9699A494 25 cgiforum

Nice to be on vacation!

Take care
Vern

On 8/6/2014 1:45 AM, Scott Klement wrote:
Vern,

One suggestion for improvement... if you are writing to a record-oriented file (such as a physical file member) I would use the Rfile QShell tool rather than just redirecting to a member. Sometimes redirecting to a PF member doesn't work quite right. (I can't remember the exact circumstances off the top of my head where it fails)

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

If outputting to a stream file, however, them using redirects is perfect.

-SK



On 8/5/2014 4:44 PM, Vernon Hamberg wrote:
Hi

If you need only the contents of the root, then you can use the ls
command in QShell and redirect output to a PF. The PF has to be a flat
file member or a source file member.

In CL, first create the PF, then run the QSH command -

CRTPF YOURLIB/YOURFILE RCDLEN(256)

QSH CMD('ls -A1 / > /qsys.lib/yourlib.lib/yourfile.file/yourfile.mbr')

That will put each file and directory on each line, including those with
a dot in the first position.

If you make the options value be -AF1, then the last character of the
names will tell you if the name is a directory or regular file or some
other kind of thing - look up the ls function in QShell documentation -
I forget.

There's a way to tell it to go down through subdirectories, but you
don't want to do that from the root, right?

HTH
Vern

On 8/5/2014 3:51 PM, Buddy McClean wrote:
Good Day,
What is the simplest way ( even if cumbersome ) to get/create a list
of filenames contained in an IFS root directory, to be used as input
by an ILE program. A batch program.
FTP is putting files in a directory and I want to know the name so I
can read via xml-into.
Thanks




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.