Execute Command

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
Magesh_bala
Participant
Posts: 86
Joined: Mon Nov 27, 2006 3:42 am
Location: Wilmington

Execute Command

Post by Magesh_bala »

Hi, I need to create the file onces the sequence is completed successfully, So i was i trying to use the Execute command stage to create the file, But i am getting the following error is this because of the Permission.

Is there any alternate option to do it.


Test_Defect..JobControl (@Execute_Command_3): Executed: /opt/Ascential/Data/AIS_MIG_MAINT/MIGRATION/TEST touch 1200_Completed.txt
Reply=126
Output from command ====>
SH: /opt/Ascential/Data/AIS_MIG_MAINT/MIGRATION/TEST: 0403-006 Execute permission denied.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You might try a command such as source to execute the script. Or request that execute permission be granted. I take it that /opt/Ascential/Data/AIS_MIG_MAINT/MIGRATION/TEST is the script for which you lack execute permission?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bkumar103
Participant
Posts: 214
Joined: Wed Jul 25, 2007 2:29 am
Location: Chennai

Post by bkumar103 »

why there is space in the file name(TEST touch 1200_Completed.txt ).
Is it a script? I got this doubt because the extension is .txt. To create a file in and directory you need the write permission in that directory and the execute permission on the script. Please make sure you have the both before running the script.
Birendra
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I suspect that the script picks up the remainder of the command line and executes it. To mind this is one unnecessarly level of abstraction, and the touch command itself may be executed directly. However, there may be in-house rules at that site, or the script may do something else first, such as switching to the appropriate directory before executing the command. Without seeing the script we'll never know.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Magesh_bala
Participant
Posts: 86
Joined: Mon Nov 27, 2006 3:42 am
Location: Wilmington

Post by Magesh_bala »

Hi,

Its not an script, I need to touch the file in the TEST folder, So i try to execute it through the execute command stage in particulat folder.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try a pipeline of commands then. What you're currently doing is trying to give the pathname of a directory as a command, so it's no wonder you're not allowed to execute. No-one can execute a directory. It's simply not permitted (as well as being meaningless).

Try this pair of commands. The && operator only executes the second command if the first succeeds.

Code: Select all

cd /opt/Ascential/Data/AIS_MIG_MAINT/MIGRATION/TEST && touch 1200_Completed.txt 
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 »

You forgot the 'cd'. And the command separator.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dsusr
Premium Member
Premium Member
Posts: 104
Joined: Sat Sep 03, 2005 11:30 pm

Post by dsusr »

try using the below command:

touch /opt/Ascential/Data/AIS_MIG_MAINT/MIGRATION/TEST/1200_Completed.txt

but for this you should have the write permission on this directory
Post Reply