Surrogate Key using sequence ?

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

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

Post by chulett »

No, you got it. Our own little game show. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

You were supposed to 'type' the file, not try to execute it.
I am typing complete file path in COMMAND block of Execute Command
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

No. you need to put the word 'type' before the path and file name. 'type' is the dos command to spit out the contents of the file onto the screen.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

Thank you very much for responce
I passed

type /demo/....../filename.txt but still it is giving me following massage:

k_ren..JobControl (@Execute_Command_2): Command type /demo/....../filename.txt did not finish OK,
reply = '1'

AND

Message:
k_ren..JobControl (@Job_Activity_7): Controller problem: Error calling DSSetParam(Return), code=-4
[ParamValue/Limitvalue is not appropriate]

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

Post by DSguru2B »

Try the 'type filename.txt' from command prompt. See if it works ok from there. Lets try to fix your first problem first. Second should go away on its own, once your get your command activity working.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

Try the 'type filename.txt' from command prompt


I dont have UNIX command prompt. BUT I am passing the same path which I used while generating flat file.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Who said anything about UNIX? It says 'command prompt', that's a generic expression for your operating system. I guess for Windows, working outside the GUI is becoming a lost art...

Click on 'Start', then 'Run...'. In the Run box put cmd and click OK, that will get you a command prompt, a.k.a a DOS prompt. Try it there. You are typing the actual full pathname to the file and not that version with six dots in the middle you keep posting, right? :?

This is not a valid pathname: /demo/....../filename.txt

Your second error message is a direct consequence of the first error. You didn't get a valid value back from your routine and the Sequence job was busted for passing in a value that was 'not appropriate'. Fix one and fix the other.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

chulett wrote: Fix one and fix the other.
Thats right, two birds with one arrow. :wink:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

Thanks for that

Now I am getting following massage:
Message:
k_ren..JobControl (@Job_Activity_7): Controller problem: Error calling DSSetParam(Return), code=-4
[ParamValue/Limitvalue is not appropriate]

Can you help me ? please ?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

What is the number in the file?
When you did 'type yourfilename' from the dos prompt, what did you see, did you see the contents of your file?
What have you set the parameter type in your second job? Is it set as string?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

Number is 35.
Jobparameter type is integer.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Inside the jobactivity, where your specifying $CommandOutput, provide the following

Code: Select all

Field(Execute_Command_2.$CommandOutput,@FM,1)
OR simply

Code: Select all

Execute_Command_2.$CommandOutput<1>
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

Yes :D It is done. I used 1st code and Job run successfully.
Thank you very much for the help.

Can you tell me why we need this ?

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

Post by DSguru2B »

The output is in the form of a dynamic array with other contents in it. They are seperated by a field marker (@FM). We are only concerned with the contents of the first field. The first code in my previous post extracts everything before the first @FM. The second code extracts the contents of the first field in the dynammic array.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The output from the command contains line terminators. So that a single string can be returned infallibly, DataStage converts the line termintators to field marks (which can be represented by the @FM system variable).
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