Dan--
On the iSeries side of the fence $ # @ are valid characters to use in names... I'd suspect they're ok in the IFS; I just created three directories with those characters as the nams and the system created them, and I was able to open the directories to see them empty.
I was surprised that there's a STMF named ? already out there...
Paul E Musselman
PaulMmn@xxxxxxxxxxxxx
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Dan
Sent: Friday, September 08, 2017 1:49 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: Acceptable characters in IFS file names
I have a program that will use CPYTOIMPF to create a .CSV file on the IFS.
Said .CSV file will then be opened in Excel.
The name of the file is generated via three key values in the data from
which it is generated. One of the values comes directly from our clients,
ergo, we have very little control over the contents (special characters) of
this value.
Before I generate the file name, I want to ensure the name is valid in
terms of actually being able to create the file and also to being able to
open it in Excel. I tested the following characters, but realized that I
have seen characters in our client's data before that do not exist on most
normal keyboards.
Characters in file name that won't work:
* (file created, but cannot be opened [specified path does not exist])
\ (file not created; "No such path or directory.")
| (file created, but cannot be opened [specified path does not exist])
: (file created, but cannot be opened [file not found by Excel])
' (file not created. "matching quote not found")
" (file not created. "matching quote not found")
< (file created, but cannot be opened [specified path does not exist])
(file created, but cannot be opened [specified path does not exist])
/ (file not created; "No such path or directory.")
? (file not created; "No such path or directory.")
I was somewhat surprised at the characters that did work: ! + =
I'm thinking of just creating a constant in my RPG program consisting of
valid characters, and replacing any in the client's value that don't match
with an underscore. Is there an official list of valid characters for file
names that can be created in the IFS *and* can be opened in Excel?
FWIW, v7r1, and this application will always and only ever be used in the
U.S., due to the nature of our business, so I want to avoid having to deal
with any CCSID issues, if that applies to this situation.
- Dan
As an Amazon Associate we earn from qualifying purchases.