I am using a TAATOOL named CVTIFS to build a database file of all the IFS directories I want to look at. The CL reads the database, which has a field with the full path name including the file name (&IFOBJP), and calls an RPG to look at location and dates and make some decisions and then return a *DELETE parameter. If the CL sees a *DELETE it does a RMVLNK OBJLNK(&IFOBJP). This works for all files in the IFS except those with an apostrophe (aka single quote) in the file name.
What's odd now is the CL doing the RMVLNK says the object is not found but executing the same command on a command line works.
In the RPG I am converting a single quote into two single quotes and added a single quote/double quote at the front and a double quote/single quote at the end and passing that back to the CL. For testing I am doing a SNDMSG to myself to see what the variable is right after the RMVLNK
RMVLNK OBJLNK(&OBJECT)
MONMSG MSGID(CPF0000)
SNDMSG MSG(&object) TOUSR(CSPGMR1)
The SNDMSG gives me this...
From . . . : CSPGMR1 07/08/09 13:15:27
'"/PCTmailAtach/777538097/20090211144647069/144647-Professional Women''s Series.pdf"'
The joblog is showing this..... (notice the single quotes are missing and the two single quotes has been changed to one
Message . . . . : Object not found. Object is
"/PCTmailAtach/777538097/20090211144647069/144647-Professional Women's
Series.pdf".
Cause . . . . . : Object
"/PCTmailAtach/777538097/20090211144647069/144647-Professional Women's
Series.pdf", or a directory in the object path, could not be found, or its
type cannot be resolved by this function. Recovery . . . : Correct the
name or specify an object of the correct type. To determine if the object
exists, use the Work with Object Links (WRKLNK) command. If the name
exists, check the type of the object. If the name contains symbolic link
objects, ensure the path names they resolve to exist. Retry the operation.
Doing this at a command line works
rmvlnk ('"/PCTmailAtach/777538097/20090211144647069/144647-Professional Women''s Series.pdf"')
Link removed.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Wednesday, July 08, 2009 1:10 PM
To: Midrange Systems Technical Discussion
Subject: Re: RMVLNK issue
I don't see why this would be necessary when working with a variable?!
Are you building a command string and passing it to QCMDEXC or something
like that? That's the only reason I can see why you'd need to double
the quotes in a variable.
Mike Cunningham wrote:
Thanks! That did work. Now is figuring out how to take a variable that looks like this
/PCTmailAtach/777472539/20090428132348043/132348-Awards List with Recipients for Presenters - Penn's Inn.xlsx
And change it to look like this
'"/PCTmailAtach/777472539/20090428132348043/132348-Awards List with Recipients for Presenters - Penn''s Inn.xlsx"'
Using CL
The beginning and ending parts will be easy, changing the single quote into two single quotes will get tricky
As an Amazon Associate we earn from qualifying purchases.