Reading a file in Sequence

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
G SHIVARANJANI
Participant
Posts: 137
Joined: Sun Jan 07, 2007 11:17 pm
Location: VISAKHAPATNAM

Reading a file in Sequence

Post by G SHIVARANJANI »

hi,

How can we read anumeric value in a file which is the out put of job1 and has to be passed as a parameter to another job.

I tried to use execute command stage with
cat <filename>

but it is giving an error as
Controller problem: value not numeric (7) - cannot execute


tried with NUM as well but check if it is numeric or not...
please suggest
jdmiceli
Premium Member
Premium Member
Posts: 309
Joined: Wed Feb 22, 2006 10:03 am
Location: Urbandale, IA

Post by jdmiceli »

Does the sequential file you wrote to have headers in it? If so, then you need to skip the first line (or stop the headers from being created). Also, is that value the only value in the file or are there more pieces of information. One more thing to consider is how your code that creates this file is handling NULLS. If it doesn't replace a NULL with zero, then you will continue to see the error.

Hopefully something in that hodgepodge helps!
Bestest!

John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services


"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
tom
Participant
Posts: 46
Joined: Fri Oct 14, 2005 12:38 am

Post by tom »

Hi ranjini,

In the excecute command activity stage

in command give value as

sh -c

and in parameters give value as

"cat filename"

pass this value as a parameter to the next jobactivity stage for the desired job using the code .

Field(EXC_Read_Seqid.$CommandOutput, @FM,1)

HTH
tom
Devlopers corner
G SHIVARANJANI
Participant
Posts: 137
Joined: Sun Jan 07, 2007 11:17 pm
Location: VISAKHAPATNAM

Post by G SHIVARANJANI »

Thanks a lot for the reply

This resolved my issue..



tom wrote:Hi ranjini,

In the excecute command activity stage

in command give value as

sh -c

and in parameters give value as

"cat filename"

pass this value as a parameter to the next jobactivity stage for the desired job using the code .

Field(EXC_Read_Seqid.$CommandOutput, @FM,1)

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

Post by chulett »

tom wrote:Field(EXC_Read_Seqid.$CommandOutput, @FM,1)
This was the important bit, the need to remove any Field Marks from the output of the cat command. You could also have used Convert or EReplace to accomplish the same thing if you needed to remove multiple occurances:

Code: Select all

Convert(@FM,"",EXC_Read_Seqid.$CommandOutput)
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Or, indeed, a DIGITS Transform.
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