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



Should be a trivial exercise once I finish up what I'm currently playing
with :)

On Thu, Jan 16, 2020 at 3:05 PM Rob Berendt <rob@xxxxxxxxx> wrote:

Bruce,
Drink the SQL kool aid. Show us how to wrap your example into a UDF so we
can
Select system_table_name, system_table_schema,
Reuse_deleted_records(system_table_name, system_table_schema)
From ...sql catalog...

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


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
Bruce Vining
Sent: Thursday, January 16, 2020 2:26 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: "Reuse Deleted Records" in System Catalog

CAUTION: This email originated from outside of the organization. Do not
click links or open attachments unless you recognize the sender and know
the content is safe.


In that case, try:

ctl-opt dftactgrp(*no);

dcl-pr RtvReuse extpgm('QDBRTVFD');
rcvVar char(65535) options(*varsize);
lenRcvVar int(10) const;
qualRtnFN char(20);
formatAPI char(8) const;
qualFileName char(20) const;
rcdFmtName char(10) const;
ovrPcs char(1) const;
system char(10) const;
formatType char(10) const;
errCde likeds(qusec);
end-pr;

/copy qsysinc/qrpglesrc,qusec
/copy qsysinc/qrpglesrc,qdbrtvfd

dcl-ds baseFD likeds(QDBQ25) based(ptrRcvVar);
dcl-ds pFAtrs likeds(QDBQ26) based(ptrPFAtrs);

dcl-ds errCde qualified;

hdr likeds(qusec);

errDta char(256);

end-ds;



dcl-s ptrPFAtrs pointer;

dcl-s ptrRcvVar pointer inz(%addr(rcvVar));

dcl-s qualRtnFN char(20);

dcl-s rcvVar char(4096);

dcl-s theFile char(10) inz('MYFILE');



errCde.hdr.QUSBPrv = 0;

RtvReuse( rcvVar :%size(rcvVar) :qualRtnFN

:'FILD0100' :(theFile + '*LIBL') :' *FIRST'

:'0' :'*LCL' :'*INT'

:errCde);

ptrPFAtrs = ptrRcvVar + baseFD.QDBPFOf;

if %bitand(pFAtrs.QDBBits33 :x'80') = x'80';

dsply 'Reuse on';

else;
dsply 'Reuse off';
endif;
*inlr = *on;
return;

where variable theFile is initialized to 'MYFILE' (real original I know)
and *LIBL is being used to resolve to the file. You can provide a theFile
value in whatever fashion you desire (parm, file,...). Note that there is
no error recovery. Pass it a "bad" file name and you'll just get good old
CPFs and RNQs.

This requires no DSPFFD and subsequent processing so it should be faster
but, as pointed out earlier, there's also nothing wrong with DSPFFD and an
outfile. Just another way to get the job done.

Bruce

On Thu, Jan 16, 2020 at 1:44 PM Gord Hutchinson <gordm1@xxxxxxxxxxxxxxx>
wrote:

Thanks, but I'd much rather do a query in one step rather than having to
create the data and then query it.


Gord



On Thu, 16 Jan 2020 at 12:20, John Yeung <gallium.arsenide@xxxxxxxxx>
wrote:

On Thu, Jan 16, 2020 at 11:34 AM Vernon Hamberg
<vhamberg@xxxxxxxxxxxxxxx> wrote:

The system catalogs would not have that, as they are very
SQL-related,
and this attribute is specific to IBM i.

That rationale is very understandable, but it's not that useful as a
heuristic for predicting what information is *actually* provided in
the catalogs. TABLE_TYPE, FILE_TYPE, SELECT_OMIT, and IASP_NUMBER are
all IBM-i-specific and would not make sense on other SQL-enabled
systems. (Even if you could find a non-IBM platform which has
something analogous to IASPs, chances are they wouldn't *call* it
IASPs. And in any case, this is utterly irrelevant to *SQL*.)

Even something like NUMBER_DELETED_ROWS isn't really relevant to SQL,
and the fact that it's available (via SQL) on the i makes it
oh-so-tantalizingly close to having something which tells you whether
those rows can be reused or not.

Gord, no matter what anyone says, there is nothing wrong with using
DSPFFD to *OUTFILE. I mean, it's definitely worth taking a look into
the catalogs; and worth asking here in case you missed something; and
you did both of those things. But even if you hadn't checked, and gone
straight to DSPFFD instead, I wouldn't fault you for that.

John Y.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com



--
Gord Hutchinson
TST Overland Express
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com



--
Thanks and Regards,
Bruce
931-505-1915
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com




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.