|
Looks nice. Maybe you would like to filter your selection a little more by<kurt.anderson@xxxxxxxxxxxxxx
using DBXTYP = 'D', omitting source files. Also, remember to use all upper
case in your file names.
A last point: if you feel confident enough, maybe you would like to delete
your files using SQL ('DROP TABLE'). That way you would be able to delete
dependent files at once (if using the default CASCADE option of the SQL
statement). Remember that you can call SQL statements easily from CL, if
needed, using QSH.
Regards,
Luis Rodriguez
IBM Certified Systems Expert - eServer i5 iSeries
--
On Wed, Aug 17, 2011 at 4:03 PM, Kurt Anderson
far.wrote:
Hi Luis,
Well I've already started my work, let's see what you think of it so
for
Essentially what I'm doing right now is coming up with a way to search
thatfiles. There is no deleting going on in this procedure.
When the procedure is called, it Declares and Opens a SQL Cursor
immediately. This means, if memory serves, that the file is read at
setone point in time. Later when I'm fetching, I'm working with a result
here...)that's already in memory.
(I'm going to call the procedures via CL, but for ease of typing
withit's something like:
FuzzyName = '*FileA'; // (or '%FileA' - the procedure will replace *
easily%)
FileAttr = 'PF'; // optional
Lib = 'MYLIB'; //optional
$FindFile( INIT: *omit: FileName: Lib: FileAttr );
DoW Found;
FilePath = $FindFile( FIND: Found ); // This will return a file from
the last fetch in the loop, or issue a new fetch if required
// - do whatever you need to do with the filepath here.
EndDo;
$FindFile( CLOSE );
It doesn't give you a list of files to refer back to, but you could
oncreate a report of all the files processed.
-Kurt
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:
midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Luis Rodriguez
Sent: Wednesday, August 17, 2011 3:08 PM
To: Midrange Systems Technical Discussion
Subject: Re: Batch Finding Files using Wildcards
Kurt,
There are some issues to consider: Do your files have LFs dependent on
them?
Also, if you read QSYS/QADBXREF directly, a new file could appear later
:-)your program, so you must be careful not to delete it.
Maybe you could consider doing first a list of your files, with DSPFD,
something like:
DSPFD FILE(*ALLUSR/*ALL)
TYPE(*BASATR)
OUTPUT(*OUTFILE)
FILEATR(*PF)
OUTFILE(MYLIB/FILELIST)
That way, you would have the "original" list of tables, just in case
something went wrong (you did not forgot to backup beforehand , did you?
something
Then, just before your RCVF in your CL, you could do a OPNQRYF,
tolike:
OPNQRYF FILE((QTEMP/FILELIST)) QRYSLT('atfile *ct ''%FILEA%''')
HTH,
Luis Rodriguez
IBM Certified Systems Expert - eServer i5 iSeries
--
On Wed, Aug 17, 2011 at 3:04 PM, Kurt Anderson <
kurt.anderson@xxxxxxxxxxxxxx
wrote:
Looks like I'll give using QSYS/QADBXREF a try.
-Kurt
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:
midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Kurt Anderson
Sent: Wednesday, August 17, 2011 2:17 PM
To: 'Midrange Systems Technical Discussion' (midrange-l@xxxxxxxxxxxx)
Subject: Batch Finding Files using Wildcards
We have a number of files that we have copies of saved with a prefix
listit.
For example:http://archive.midrange.com/midrange-l.
FILEA, FILEB
ABCFILEA, ABCFILEB
XXXFILEA, XXXFILEB
This is the case across multiple libraries, and the prefixes can be
virtually anything, although I know it's always 3 long.
What I'd like to do is something like:
WRKOBJPDM LIB(MYLIB) OBJ(*FILEA) OBJTYPE(*FILE) However this isn't
allowed in batch mode.
I have a CL program that is going to spin through our libraries to
work with these files. What I will be doing with these files is
probably renaming them, creating a new file with the same name, and
copy map/dropping the data back in then deleting the old file.
Can anyone point me in the right direction?
Thanks,
Kurt Anderson
Sr. Programmer/Analyst
CustomCall Data Systems
--
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
--
--
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.
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
listTo 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.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
listTo 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.
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
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.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.