Problem with 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

sshettar
Premium Member
Premium Member
Posts: 264
Joined: Thu Nov 30, 2006 10:37 am

Problem with execute_command activity

Post by sshettar »

Hi All,

Well i have this job sequence where the flow goes like this

Waitforfile......>job _activity.....> execute_cmmand activity

well in wait for file i'm waiting for a .txt file from the mainframes for abt 30sec (as of now i have given)
and once that arrives i trigger one of my job whose input is this .txt file and i do certain transformations ans create another file. once this job runs successfully i trigger the execute command stage in which i am actually trying to replace the .txt file from mainframe to .arc file.
well this replace should only be done provided my job_activity runs successfully.
but the command doesnt seems to work
the command i have given is
mv #filepath#/#OldFile# #filepath#/#NewFile#
these parameters i have described in the job parameter of the job sequence
where both the files are in the same directory
and old file is the .txt file and new file is the .arc file
both files have same name only the extension differes

well the job sequence runs successfully but the command doesnt seem to have executed.

why do you think the command doesnt seems to work.
Help needed please

Thanks in advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Check the log of the job sequence to see whether the Execute Command activity actually executed. What kind of trigger do you have on the Job activity?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Did you put the 'mv' part in the Command section and the '#filepath#/#OldFile# #filepath#/#NewFile#' in the Parameters section? Double-checked the spelling and case of each parameter name?

What does the log entry show for the stage when the job runs? Cut-and-paste, please no hand typing.
-craig

"You can never have too many knives" -- Logan Nine Fingers
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

Take a look what's the message in the "Output from command===>" of your Execute_Command_3.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

If you are using windows OS you should be using move instead of mv.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

Narasimha,
He is using 7.5x2 EE version; "mv" will work just fine for his Execute_Command stage to rename the file.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

lstsaur,

You might be right.
But I did not find the reference to the version though.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Due to the reason MKS Toolkit is shipped with the product and hence unix commands can be executed.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

You should also see the command that been executed in Log.
Make sure that you are working with full file that been FTPed. By some chance, the partial FTPed file migth cause some error.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
sshettar
Premium Member
Premium Member
Posts: 264
Joined: Thu Nov 30, 2006 10:37 am

Post by sshettar »

well i tried using even move instaed of mv but doesnt seem to work .
to test what i did was i used wairforfile and then execute command. i created a dummy file called test.txt
and i ran for job where in the wait for file checks is test.txt is already present . as it was it triggered the execute command activity.
and the job ran successfully . but it doesnt seem to have created test.arc and neither dropped the file test.txt.
the log read as follows

Starting Job WaitForFileTest.
DropPath = /ascential/datastage/70/d02
OldFile = test.txt
NewFile = test.arc

Environment variable settings:
_=/usr/bin/nohup
BWInstance=UND
LANG=en_US
LOGIN=dsadm
OraclePassword=apr7671
Project=SalesVolume
OraclePasswordETQ=apr7671
APT_ORCHHOME=/ascential/datastage/70/UND/Ascential/DataStage/PXEngine
MSAFilePath=/ascential/datastage/70/data
RFC_TRACE=0
SYBASEHost=pm602.rncpmu.com,2025
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java130/jre/bin:/usr/java130/bin:/db2/db2pmutc/sqllib/bin:/db2/db2pmutc/sqllib/adm:/db2/db2pmutc/sqllib/misc:/oracle/usa/9.2.0/bin:/usr/opt/db2_08_01/bin:/db2/db2pmutc/sqllib/bin:/db2/db2pmutc/sqllib/adm:/db2/db2pmutc/sqllib/misc:/oracle/usa/9.2.0/bin:/usr/opt/db2_08_01/bin:/usr:/usr/vacpp:/usr/vacpp/bin
DB2DIR=/usr/opt/db2_08_01
DB2Host=RHDB2T
OracleServerETQ=ID28.WORLD
LC__FASTMSG=true
DSSAPHOME=/ascential/datastage/70/UND/Ascential/DataStage
OracleLoginIDFrict=ETL_APP
LOGNAME=shettas
SYBASELogonID=OPSEDGEID
LOCPATH=/usr/lib/nls/loc
USER=dsadm
AUTHSTATE=compat

DEFAULT_BROWSER=netscape
SHELL=/usr/bin/ksh
DropPointPath=\Pmuryeafsq01pmespenddata-dv
DSHOME=/ascential/datastage/70/UND/Ascential/DataStage/DSEngine
ODMDIR=/etc/objrepos
DB2DSN=RHDB2T
HashFilePath=/ascential/datastage/70/d01/SalesVolume
SYBASEPassword=Ops,Edge0
FTPServerName=CPUE.RYE.US.PM.COM

DS_START_LOG=/ascential/datastage/70/UND/DS_START.log
ODBCINI=/ascential/datastage/70/UND/Ascential/DataStage/DSEngine/.odbc.ini
HOME=/ascential/datastage/70/UND
DB2INSTANCE=db2pmutc
TERM=
LD_LIBRARY_PATH=:/db2/db2pmutc/sqllib/lib:/oracle/usa/9.2.0/lib:/db2/db2pmutc/sqllib/lib:/oracle/usa/9.2.0/lib
ORACLE_HOME=/oracle/usa/9.2.0
OracleServerFrictionless=ID13.WORLD
THREADS_FLAG=native
DB2Password=use $ENV
PWD=/ascential/datastage/70/UND/Ascential/DataStage/DSEngine
RFC_TRACE_DIR=/ascential/datastage/70/UND/Ascential/DataStage/DSBWConnections/LOG
TZ=EST5EDT
OracleServer=ID28.WORLD
SourceSystem=DSDEV
SeqFilePath=/ascential/datastage/70/d01/SalesVolume
DB2LoginID=ETL999R
OracleLoginID=ETL_APP
OracleLoginIDETQ=ETL_APP
INSTHOME=/db2/db2pmutc
DS_USERNO=-22429
WHO=SalesVolume
BELL=^G
FLAVOR=-1
LIBPATH=usr/opt/db2_08_01/lib:/ascential/datastage/70/UND/Ascential/DataStage/branded_odbc/lib:/ascential/datastage/70/UND/Ascential/DataStage/DSEngine/lib:/ascential/datastage/70/UND/Ascential/DataStage/DSEngine/uvdlls:/ascential/datastage/70/UND/Ascential/DataStage/DSEngine/java/jre/bin/classic:/ascential/datastage/70/UND/Ascential/DataStage/DSEngine/java/jre/bin::/oracle/usa/9.2.0/lib32:/oracle/usa/9.2.0/rdbms/lib32:/usr/lib
FSIFilePath=/ascential/datastage/70/d02/FSI
ORACLE_SID=ID28.WORLD
ScriptFilePath=/ascential/datastage/70/d01/SalesVolume/Scripts
LUPath=/ascential/datastage/70/d02/PMCS/LU
DataSetPath=/ascential/datastage/70/d02/PMCS/DataSets
StagePath=/ascential/datastage/70/d02/PMCS/Staging
DS_ENABLE_RESERVED_CHAR_CONVERT=0
DS_TDM_PIPE_OPEN_TIMEOUT=720
DS_TDM_TRACE_SUBROUTINE_CALLS=0


WaitForFileTest..JobControl (DSWaitForFile): File '/ascential/datastage/70/d02/test.txt' is already present

WaitForFileTest..JobControl (@Execute_Command_1): Executed: mv #Path#/OldFile# #Path#/test.arc
Reply=1
Output from command ====>
Usage: mv [-i | -f] [--] src target
or: mv [-i | -f] [--] src1 ... srcN directory

Finished Job WaitForFileTest.

why do you think the commad is not working

well the command i have given is

mv #Path#/OldFile# #Path#/#NewFile#

and i have also given the default values of these parameters in the job parameter

can somebody please help me witht this issue

Thanks in advance
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Because its taking the parameter values literally. WHere are you providing the parameters?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sshettar
Premium Member
Premium Member
Posts: 264
Joined: Thu Nov 30, 2006 10:37 am

Post by sshettar »

i'm giving the defining the parameters in the job parameter.

and the command is in the command_execute activity
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

sshettar wrote:WaitForFileTest..JobControl (@Execute_Command_1): Executed: mv #Path#/OldFile# #Path#/test.arc
Reply=1
Output from command ====>
Usage: mv [-i | -f] [--] src target
or: mv [-i | -f] [--] src1 ... srcN directory
Well for some reason its not taking the parameter names. You are also missing a hash sign before OldFile. Fix that.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

sshettar wrote:mv #Path#/OldFile# #Path#/#NewFile#
Well, there's one obvious problem - assuming this accurately represents what is in your job, you are missing a 'hash' or 'pound' sign:

Code: Select all

mv #Path#/#OldFile# #Path#/#NewFile#
However, since none of the properly formatted job parameters were translated in the log, you have a couple of other possible issues. One of which has already been asked - are the parameters in the proper place in the stage.

The other issue is the fact that some versions of DataStage are broken in that regard. The Execute Command stage just plain ol' doesn't take parameters in that case, no matter how properly you do things. What exact version are you running?

If that's the case, you'll need to switch to a Routine Acitivity stage, pass in your parameters there and leverage the 'DSExecute' function to accomplish this.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sshettar
Premium Member
Premium Member
Posts: 264
Joined: Thu Nov 30, 2006 10:37 am

Post by sshettar »

well in the execute_command stage , in exeCommand tab under command i have given this command
mv #Path#/#OldFile# #Path#/#NewFile#

and in the parameter i have not given anything .

instead in the job parameter of the entire sequence i have defined the parameters for Path
OldFIle, NewFile

Please correct if i am wrong
and the version of DS i'm using is 7.0

and also could somebody guide me in using the routine activity stage instead.
Post Reply