Have you tried the IBM Service IFS_UNLINK in the SYSTOOLS schema?
https://www.ibm.com/docs/en/i/7.6.0?topic=services-ifs-unlink-scalar-function

Mit freundlichen Grüßen / Best regards

Birgitta Hauser
Modernization – Education – Consulting on IBM i
Database and Software Architect
IBM Champion since 2020

"Shoot for the moon, even if you miss, you'll land among the stars." (Les Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them and keeping them!"
"Train people well enough so they can leave, treat them well enough so they don't want to. " (Richard Branson)
"Learning is experience … everything else is only information!" (Albert Einstein)


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Rob Berendt
Sent: Friday, 31 October 2025 19:56
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Handling special characters in an ifs file name

Now the only ones left were a small handful of directories ending with .TMP. That service doesn't handle directories. But the number was small enough I was able to handle by hand.
Thanks again.

On Fri, Oct 31, 2025 at 2:29 PM Rob Berendt <robertowenberendt@xxxxxxxxx>
wrote:

Thank you! It appears that worked. To verify I'm rebuilding the
output file and that takes a spell.

On Fri, Oct 31, 2025 at 2:23 PM cesco via MIDRANGE-L <
midrange-l@xxxxxxxxxxxxxxxxxx> wrote:

Rob,have you tried IFS_UNLINK directly to avoid escaping into
QCMDEXC and hacking with strings?
The thing is that IBMi supports filename with also unicode ccsid (not
in the content, but the name itself, there is a ccsid even at that
level), so you can have legitimately for example files named with
chinese ideograms mixed with basic latin.... in fact
IFS_OBJECT_STATISTICS returns UTF8 as a file name...



On Friday, October 31, 2025 at 06:58:12 PM GMT+1, Rob Berendt <
robertowenberendt@xxxxxxxxx> wrote:

Rob Berendt <robertowenberendt@xxxxxxxxx>
1:56 PM (0 minutes ago)
to Midrange
Resending, with a subject line this time.

I used the IFS_OBJECT_STATISTICS to generate a list of temporary
files throughout the system I want to delete.
create table rob.tmpfiles as(
select *
from table (qsys2.ifs_object_statistics(
START_PATH_NAME *=>* '/',
SUBTREE_DIRECTORIES *=>* 'YES'
, OBJECT_TYPE_LIST *=>* '*NOQDLS *NOQOPT *NOQSYS'
))
WHERE PATH_NAME LIKE '%.TMP'
OR PATH_NAME LIKE '%.tmp'
OR PATH_NAME like 'heapdump%'
OR PATH_NAME like 'javacore%'
OR PATH_NAME like 'Snap%') WITH DATA;

I verified the contents are what I want.

I'm trying to pass the column containing the file name to a command
to delete it select PATH_NAME, qcmdexc('DEL OBJLNK(' *concat* ''''
*concat* PATH_NAME
*concat* '''' *concat* ')')
from rob.tmpfiles

Generally it works. Out of about 6k files I'm down to 200 left.
These have characters like an apostrophe or a parenthesis in the file
name. I'm getting tired of playing silly games to count apostrophes and whatnot.

How do I blast these?

Is there any use for the columns FILE_IDENTIFIER_NUMBER,
GENERATION_IDENTIFIER, FILE_SYSTEM_IDENTIFIER, FILE_IDENTIFIER? Can
they be used somehow, instead of PATH_NAME to delete these files?
--
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@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.


--
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@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.


--
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@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.