If you want to know which files is used you can join sysfiles with library_list_info, sort it by "ordinal_position" and limit it to 1 - this is the file, that would be accessed.

But in reality it's a bit more complicated - because OVRDBF might be in effect - AFAIK this can only be found out, when opening the file and using the INFDS like you already did.

HTH
Daniel



Von meinem iPhone gesendet
Am 11.12.2024 um 00:33 schrieb Marco Facchinetti <marco.facchinetti@xxxxxxxxx>:

Do you mean retrive the library name when using something like: Select
myfield into :MyRpgField from envrsq01 where TheKey = :RpgKey;?

--
Marco Facchinetti

Mr S.r.l.

Tel. 035 962885
Cel. 393 9620498

Skype: facchinettimarco


Il giorno mar 10 dic 2024 alle ore 16:52 Slanina, John via RPG400-L <
rpg400-l@xxxxxxxxxxxxxxxxxx> ha scritto:

Hello,
I can I replace this statements with SQL in RGPLE Free ?

dcl-f envrsq01 disk usage(*input) keyed INFDS(infds);

dcl-ds infds;
library char(10) pos(93);
end-ds;

I need the library name for where the file is.

Thanks
John Slanina



--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.


--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.


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.