Routine to zip a file

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Routine to zip a file

Post 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.
Luciana
Participant
Posts: 60
Joined: Fri Jun 10, 2005 7:22 am
Location: Brasil

Post 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.
Luciana Almeida
lucianacruz@gmail.com
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You get this error when - compile time, run time, what? Also, is "fil1" a local variable you've built as well?
-craig

"You can never have too many knives" -- Logan Nine Fingers
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

I have checked the value of ucom1. It is looking fine.
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

I got this error while executing the routine.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Post the unedited log message (copy/paste) that shows the 'executed command'. And answer the question about 'fil1'.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post 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
Post Reply