Topic
  • 3 replies
  • Latest Post - ‏2014-01-31T11:51:37Z by VolkerFriedrich
jcadam14
jcadam14
7 Posts

Pinned topic Spaces in filepath causes error in SUBMIT

‏2014-01-24T15:24:10Z |

I have the following process:

COPYTOB PROCESS
    &File=""
    &Name=""
    &FilePath=""
    &ZipFile="&FilePath&Name..zip"
    SNODE=BSERVER
    CRC=ON

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

CALLCOPY SUBMIT FILE="S:\ConnectDirect\Process\CopyProcess.cdp"
    &SourceFile="&ZipFile"
    &DestinationPath="&FilePath"

PEND

When I run this process with a file path, either through Requester or FileAgent, it works fine with file paths that do not contain spaces.  However, if the file path has a space, the zip file is created, but the CALLCOPY step that does the SUBMIT throws the following:

LAPP013I - An invalid keyword value was found

I tried putting quotes (both single and double) around the path with spaces when submitting via Requester, but that doesn't work.  What am I doing wrong here in my script?  While I could put everything in one big process, there is some reuse that I would like to do across scripts so getting the SUBMIT to work correctly with spaces would be extremely helpful.

Also, my CopyProcess also uses SUBMIT to call another process.  If I run the scripts individually, each one successfully does the previous tasking until the SUBMIT, at which point the same error is thrown.  And this only happens for filepaths with spaces, so I'm pretty sure the SUBMIT is the problem child.

Thanks!
Jason

Updated on 2014-01-24T18:30:18Z at 2014-01-24T18:30:18Z by jcadam14
  • VolkerFriedrich
    VolkerFriedrich
    175 Posts

    Re: Spaces in filepath causes error in SUBMIT

    ‏2014-01-30T16:52:21Z  

    The problem occurs in your CALLCOPY steps when you want to pass on values that contain spaces. You were already on the right track using single and double quotes. The trick is to encapsulate a single quote into another variable. The solution doesn't look particular nice, but it works for me.

    COPYTOB PROCESS
        &Q="'"                  <--- double quotes + single quotes + double quotes

    ...

    CALLCOPY SUBMIT FILE="S:\ConnectDirect\Process\CopyProcess.cdp"
        &SourceFile="&Q&ZipFile&Q"
        &DestinationPath="&Q&FilePath&Q"

     

  • jcadam14
    jcadam14
    7 Posts

    Re: Spaces in filepath causes error in SUBMIT

    ‏2014-01-30T18:16:21Z  

    The problem occurs in your CALLCOPY steps when you want to pass on values that contain spaces. You were already on the right track using single and double quotes. The trick is to encapsulate a single quote into another variable. The solution doesn't look particular nice, but it works for me.

    COPYTOB PROCESS
        &Q="'"                  <--- double quotes + single quotes + double quotes

    ...

    CALLCOPY SUBMIT FILE="S:\ConnectDirect\Process\CopyProcess.cdp"
        &SourceFile="&Q&ZipFile&Q"
        &DestinationPath="&Q&FilePath&Q"

     

    Mwahahahaha you are a genius!  Yeah, I don't care if it isn't exactly pretty, but it works.  Thank you very much, this has saved me much frustration!  Works great with all directory structures I've tested so far.  Again, thanks.

  • VolkerFriedrich
    VolkerFriedrich
    175 Posts

    Re: Spaces in filepath causes error in SUBMIT

    ‏2014-01-31T11:51:37Z  
    • jcadam14
    • ‏2014-01-30T18:16:21Z

    Mwahahahaha you are a genius!  Yeah, I don't care if it isn't exactly pretty, but it works.  Thank you very much, this has saved me much frustration!  Works great with all directory structures I've tested so far.  Again, thanks.

    Cool  :-)