Executing Two dos commands in Execute Command Activity

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Xpert
Premium Member
Premium Member
Posts: 85
Joined: Wed Mar 01, 2006 7:17 am

Executing Two dos commands in Execute Command Activity

Post by Xpert »

Hi,

Pls anyone tell me, how to execute two DOS commands in Execute Command. One command is to move the file from one directory to another and another command is to rename that moved file by adding current date with that file name. And also i have to pass the file name by parameter.


My Scenario is,

Once the file is processed sucessfully then i have to move that file to another directory by adding processed date with that file name. Pls help me, Thnx in Advance.
With regards,
Xpert
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You mean something like "cd c:\temp | dir"?[/b]
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

move #Old_Pdath#\#Old_Filename# #New_Path#\#New_Filename##Date_parameter#
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Xpert
Premium Member
Premium Member
Posts: 85
Joined: Wed Mar 01, 2006 7:17 am

Post by Xpert »

kumar_s wrote:move #Old_Pdath#\#Old_Filename# #New_Path#\#New_Filename##Date_parameter# ...
Hi Kumar,

Thanx a lot......
With regards,
Xpert
Xpert
Premium Member
Premium Member
Posts: 85
Joined: Wed Mar 01, 2006 7:17 am

Post by Xpert »

Xpert wrote:
kumar_s wrote:move #Old_Pdath#\#Old_Filename# #New_Path#\#New_Filename##Date_parameter# ...
Here we are hardcoding the date value by passing parameter. how to use DSJobStartDate in this condition.
With regards,
Xpert
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

DSJobStartDate of what? If its the for the job that produce the file, you can use UserVariable Activity or Routine activity and use the same command DSJobStartDate and pass as UserStatus.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ersunnys
Participant
Posts: 29
Joined: Wed Sep 13, 2006 1:39 pm
Location: Singapore

Post by ersunnys »

kumar_s wrote:move #Old_Pdath#\#Old_Filename# #New_Path#\#New_Filename##Date_parameter# ...
I am trying to give my JOBS parameters to connect to sqlplus, but it is not connecting... can anyone help me in this...

i am using...

print "select * from tab;" | sqlplus -s #userid#/#passwd#@#domain#


please correct me if this command is wrong and tell me how to do the same.
Regards,
Sunny Sharma.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Try this
In the Command box

Code: Select all

 sqlplus -s 
and in the Parameters box

Code: Select all

#userid#/#passwd#@#domain# && select * from tab;
Kris

Where's the "Any" key?-Homer Simpson
ersunnys
Participant
Posts: 29
Joined: Wed Sep 13, 2006 1:39 pm
Location: Singapore

Post by ersunnys »

Last edited by ersunnys on Thu Sep 14, 2006 11:40 am, edited 1 time in total.
Regards,
Sunny Sharma.
ersunnys
Participant
Posts: 29
Joined: Wed Sep 13, 2006 1:39 pm
Location: Singapore

Post by ersunnys »

kris007 wrote:Try this
In the Command box

Code: Select all

 sqlplus -s 
and in the Parameters box

Code: Select all

#userid#/#passwd#@#domain# && select * from tab;
This is not working, output is
Executed: sqlplus -s userid/passwd@domain && select * from tab;
Reply=0
Output from command ====>

SQL*Plus: Release 8.1.7.0.0 - Production on Thu Sep 14 18:27:39 2006

(c) Copyright 2000 Oracle Corporation. All rights reserved.

Enter user-name:
the command is getting genrated but its not showing the output. If i hardcode the values of userid, passwd and domain, its working fine...

wht is the problem i m not getting
Regards,
Sunny Sharma.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

sqlplus -s userid/passwd@domain && select * from tab;
I don't think you can even execute this complete statement from the command line too. What exactly are you trying to do from the execute command stage? Do you want to run a script or run some sql commands?
Kris

Where's the "Any" key?-Homer Simpson
ersunnys
Participant
Posts: 29
Joined: Wed Sep 13, 2006 1:39 pm
Location: Singapore

Post by ersunnys »

kris007 wrote:
sqlplus -s userid/passwd@domain && select * from tab;
I don't think you can even execute this complete statement from the command line too. What exactly are you trying to do from the execute command stage? Do you want to run a script or run some sql commands?

I am able to run
print "select * from tab;" | sqlplus -s #userid#/#passwd#@#domain#
from command line...

i want to execute a single statement in the stage...
Regards,
Sunny Sharma.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That IS a single statement.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply