compiling and executing jobs from command prompt

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
pras
Premium Member
Premium Member
Posts: 32
Joined: Mon Nov 28, 2005 8:33 am
Location: Atlanta

compiling and executing jobs from command prompt

Post by pras »

Hi,

we are passing file name has parameter and running the job in unix environment(shell)

my $DShome is /edw/devel/apps/home/dsadm/Ascential/DataStage/DSEngine/bin

when i executed the job it shows "Status code = 0? "

i need to chage file name alone for a single jon for about 30 times so written a batch file.

please give me idea how to comiple the job from command prompt itself

my code is
dsjob -run -param File=edw/devel/apps/home/dsadm/nau_dev_7/NetappU/FlatFileLoad/NAU_DataMart_Out_20070109222531_1.dat nau_dev_7 CopyOfSampleFile2

expecting ur help in this regard
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Re: compiling and executing jobs from command prompt

Post by narasimha »

pras wrote: please give me idea how to comiple the job from command prompt itself
There is no way to compile the jobs from the command line. But there is an option to reset the job though.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
pras
Premium Member
Premium Member
Posts: 32
Joined: Mon Nov 28, 2005 8:33 am
Location: Atlanta

Post by pras »

Please let me know abt that option.. am brand new to DS.

and please comment on my code which i tries running in command prompt
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

You don't need to recompile the your job if you are just passing different parameters each time.
If your job gets aborted due to some reason you can reset it and then run.

Code: Select all

dsjob -run -mode RESET  ProjectName JobName
I don't see any problem with your code, do you get any errors?
You can get a lot of code samples here if you do a search.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
pras
Premium Member
Premium Member
Posts: 32
Joined: Mon Nov 28, 2005 8:33 am
Location: Atlanta

Post by pras »

hi when i tried running with reset mode i am getting the below error

Status code = -2?DSJE_BADSTATE

and says error running job

my code is

dsjob -run -mode RESET -param File=/edw/devel/apps/home/dsadm/nau_dev_7/NetappU/FlatFileLoad/NAU_DataMart_Out_20070109222531_1.dat nau_dev_7 CopyOfSampleFile2


dsjob -run -mode RESET -param File=/edw/devel/apps/home/dsadm/nau_dev_7/NetappU/FlatFileLoad/NAU_DataMart_Out_20070109222531_10.dat nau_dev_7 CopyOfSampleFile2


dsjob -run -mode RESET -param File=/edw/devel/apps/home/dsadm/nau_dev_7/NetappU/FlatFileLoad/NAU_DataMart_Out_20070109222531_11.dat nau_dev_7 CopyOfSampleFile2


when i try running individually its working fine even with our rest mode

please advice me
pras
Premium Member
Premium Member
Posts: 32
Joined: Mon Nov 28, 2005 8:33 am
Location: Atlanta

Post by pras »

ANY SUGGESTIONS :?:
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes.

Stop being impatient.

Don't shout.

DSXchange is an all volunteer site, no-one gets paid (apart from the webmaster). Folks post as and when they can. If you want urgent answers, sign up for premium service from your support provider and learn how much "urgent" really costs.

I thought narasihma's contributions were clear and to the point.

With a tiny bit more experience with DataStage, you will learn that a running job (irrespective of run mode) can not be run a second time, unless it is a multi-instance job with a different invocation ID.

I will respond with the rest of the answer tomorrow morning (my time).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pras
Premium Member
Premium Member
Posts: 32
Joined: Mon Nov 28, 2005 8:33 am
Location: Atlanta

Post by pras »

Hi,

i just asked did any one has any suggestions for me.. i am afraid their is nothing to get angry towards me.

:oops: really Frightened by ur words !!!!!!!!
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

All caps is usually a sign of shouting. As Ray explained, it is an All Volunteer site. Putting comments like "ANY SUGGESTIONS" only rubs the posters the wrong way and hence Ray's reaction. Be patient, your quests will be answered. And dont be frightened of Ray, he is a pretty cool guy and you will get to learn a lot from him. So stick around.
Regards,
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

You need to look into what Ray wanted to convey to you.


Search the forum for "Status code = -2" you sould get a solution.
Found an explainationby Craig
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The "bad state" means that the job is not in a runnable state.

If attempting to run it in reset mode returns this status, it suggests that the job was not even in a resettable state. This can mean that the job is currently running, has not been compiled, or perhaps is crashed. Determine the job status (using dsjob -jobinfo projectname jobname command).

You can only legally run a job once (unless it is a multi-instance job with separate invocation IDs, which effectively makes them separate jobs); your post suggests that you attempted to effect three reset runs. If the job was already running (whether in normal, validate or reset mode), you should expect these all to return DSJE.BADSTATE.

As for "impatient" - you waited less than 30 minutes before complaining that no-one had answered your post. This was out of hours in my time zone - I was having dinner at the time. Others probably had their own reasons for not being logged in at a time that suited your demands.

If you want urgent support, sign up for premium service with your support provider, and learn the true cost of "urgent"!

And you complained in all caps which, as was mentioned by DSGuru2B, is "shouting" and poor netiquette.

That, combined with your impatience, was offensive. That is why I imposed a personal "time penalty" on the rest of this response.
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