Zip a file

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Come on... do you really need me to spell it out for you? It comes with a manual (look for the 'RAR command line syntax' section) and I'm sure your Googler ain't broke. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
basu.ds
Participant
Posts: 118
Joined: Tue Feb 06, 2007 12:59 am
Location: Bangalore

Post by basu.ds »

Thanks for all
This is the command i used to zip a file
c:program files\winrar\winrar.exe a d:\test\abd.zip d:\test\abc.txt
can any bod explore this command how to make work using datastage



Thaks a lot
basu.ds
Participant
Posts: 118
Joined: Tue Feb 06, 2007 12:59 am
Location: Bangalore

Post by basu.ds »

infact this is the error message i am getting
"BeforeJob (ExecDOS): Error when executing command: zipfile.bat
*** Output from command was: ***
'zipfile.bat' is not recognized as an internal or external command,
operable program or batch file."

batchfile code:
c:
cd program files
cd winrar
winrar.exe a D:\TEST\abc.zip D:\TEST\abc.txt
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Normal path issue, doing an exact search for "is not recognized as an internal or external command" will reveal all.
-craig

"You can never have too many knives" -- Logan Nine Fingers
basu.ds
Participant
Posts: 118
Joined: Tue Feb 06, 2007 12:59 am
Location: Bangalore

Post by basu.ds »

Thanks chullett
I will search on forum
This is my new batch file

set path="C:\Program Files\WinRAR\";%path%
cd /d
winrar.exe a D:\TEST\abc.zip D:\TEST\abc.txt

Thanks a lot
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... it's working for you now?
-craig

"You can never have too many knives" -- Logan Nine Fingers
basu.ds
Participant
Posts: 118
Joined: Tue Feb 06, 2007 12:59 am
Location: Bangalore

Post by basu.ds »

No chullet,
I did not understand what i need to do job is running long time i am no able to stop also.
I was set the path in environment variable there we have all path values .
still i am not able to resolve

any help Appreciable

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You didn't need to change your .bat file, just how you called it in the stage. It couldn't find it because that directory is not in your $PATH (as you noticed) so just fully path the command.

Meaning, than executing "zip.bat", execute "C:\temp\zip.bat" instead, of course after replacing the path I used with your real one. And your first batch file 'cd' commands would have worked better than your new one as you never told it where to 'cd' to. Never mind that they really aren't needed if you've successfully amended the PATH in your batch... or if you fully path that .exe as well, much like the zip batch.

ps. All this is your basic "command line 101" entry level stuff, but I'm guessing this is foreign territory to you. This would be a good (as in useful) skill for you to pick up as it will help you in both the Windows/DOS and UNIX worlds.
-craig

"You can never have too many knives" -- Logan Nine Fingers
basu.ds
Participant
Posts: 118
Joined: Tue Feb 06, 2007 12:59 am
Location: Bangalore

Post by basu.ds »

Thanks a lot chulett,
my batch file is located in D:\ so that i given after sobroutine D:\batchfile.bat but job is hanging any reason
should i try with "D:\batchfile.bat"?(quotes)
or any other reason?

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That should be fine, however... did you run this latest version from the CMD line yourself? Did it stop and ask you any questions? If so, that's one typical reason for a 'hang' in job, there's no-one to answer the question.
-craig

"You can never have too many knives" -- Logan Nine Fingers
basu.ds
Participant
Posts: 118
Joined: Tue Feb 06, 2007 12:59 am
Location: Bangalore

Post by basu.ds »

yes,i ran from cmd but i am getting just blink screen while running this batch file ,nothing is asking


thanks
qutesanju
Participant
Posts: 373
Joined: Tue Aug 26, 2008 4:52 am

Post by qutesanju »

In your BATCH FILE You can put PAUSE....

If in case you want see error occured in BATCH FILE you can use following code---------->

echo ERRORLEVEL %ERRORLEVEL%

IF %ERRORLEVEL% == 1 (SET ERRORLEVEL=0)

echo ERRORLEVEL %ERRORLEVEL%
-----------------------------------------------------

basu.ds wrote:yes,i ran from cmd but i am getting just blink screen while running this batch file ,nothing is asking


thanks
qutesanju
Participant
Posts: 373
Joined: Tue Aug 26, 2008 4:52 am

Post by qutesanju »

You are getting blink screen because....
batch file executes it's code immedialtely on command prompt

and you didnt entered error handling or PAUSE command in BATCH file code.......
basu.ds wrote:yes,i ran from cmd but i am getting just blink screen
while running this batch file ,nothing is asking


thanks
Last edited by qutesanju on Mon Jun 01, 2009 6:26 am, edited 1 time in total.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You are getting a "blank" screen (as assumed) or a "blink" screen (as written)? If the latter, what the heck does that mean?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply