Page 1 of 1

Routine to zip a file

Posted: Tue Apr 07, 2009 11:38 am
by vinothkumar
Hi,
I am writing a routine to check the format of the file. If it is a file with .txt extension I need to zip it. I am using following lines to zip my file. But it is giving error message 'UnMatched Quotation Marks'

ucom1 = 'zip /chcprov/tempdir/Eload.zip '
ucom1 = ucom1:'/chcprov/tempdir/':inrec
CALL DSExecute('UNIX',ucom1,fil1,SYSRET)

where inrec contains the file name having *.txt extn. If I hardcode the file name in above statements it is working fine.

Posted: Tue Apr 07, 2009 11:54 am
by Luciana

Code: Select all

ucom1 = 'zip /chcprov/tempdir/Eload.zip ' 
ucom1 = ucom1:'/chcprov/tempdir/':inrec 
* CALL DSExecute('UNIX',ucom1,fil1,SYSRET) 

Ans = ucom1
Include "*" before the line Call DSExecute ... and print the ucom1 variable. Check if the command is right.

Posted: Tue Apr 07, 2009 12:10 pm
by chulett
You get this error when - compile time, run time, what? Also, is "fil1" a local variable you've built as well?

Posted: Tue Apr 07, 2009 12:21 pm
by vinothkumar
I have checked the value of ucom1. It is looking fine.

Posted: Tue Apr 07, 2009 12:22 pm
by vinothkumar
I got this error while executing the routine.

Posted: Tue Apr 07, 2009 3:03 pm
by chulett
Post the unedited log message (copy/paste) that shows the 'executed command'. And answer the question about 'fil1'.

Posted: Wed Apr 08, 2009 7:57 am
by vinothkumar
Value of ucom1= zip /xyz/abc/Eload.zip /xyz/abc/FILE1.txt

Error Message from routine :
Result = Unmatched quotation marks.
Verb """ is not in your VOC.

fil1 is a local variable defined in routine