IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 1 reply
  • Latest Post - ‏2013-04-19T18:08:08Z by jcadam14
jcadam14
jcadam14
7 Posts

Pinned topic Spaces in directory causing error

‏2013-04-19T16:38:45Z |

Following examples found online, I have been trying to get a script to run that contains a directory with spaces in the name.  The script zips up the directory using 7-zip.  From what I can tell, you should use ~" around args that contain special characters.  I have the following:

DOALL PROCESS
    &FilePath=""
    &ZipFile="&FilePath..7z"
    SNODE=SECSERVER
    CRC=ON

DOZIP RUN TASK PNODE (PGM=Windows)
    SYSOPTS="cmd(7z a ~"&ZipFile~" ~"&FilePath~")"

However, when submitting this process, I get "LAPP013I - Invalid usage in this statement : - ,error at line 2. CCODE=8 FDBK=0"

It seems setting the FilePath variable is causing errors.  If I put the directory directly into that variable surrounded by quotes things work fine.  But if I pass the variable into the process, I get the error.

I've tried a variety of ways to build the SYSOPTS statement, but I don' t think that's the issue.  It seems to be with passing the variable in.

Is there anything I should be doing differently when passing in a value that contains spaces to a process?

Thanks

Jason

  • jcadam14
    jcadam14
    7 Posts

    Re: Spaces in directory causing error

    ‏2013-04-19T18:08:08Z  

    Ah, discovered if, when you submit the process through the GUI, if you add a " around the input, it will go through successfully.  Very strange, but got it working.