How do I retain value of a variable throughout the file...?

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
Shaina Austin
Participant
Posts: 17
Joined: Wed Jul 07, 2004 7:59 am

How do I retain value of a variable throughout the file...?

Post by Shaina Austin »

Hi All:

I have a variable length positional input file, upon which I use the CFF(Complex Flat File Stage) and separate the like records in different files.

So now I have a Header file which has only one record.
8 sequencial files with different record types in it.
And one Trailer/footer file with only one record.

This job picks up all the detail records and add the header fields to them. There is only one header record and the field values should get repeated in all the detail records.

I tried storing the header values in stage variables, but only the 1st detail record picks up the value, the variable does not retain the value for the following records.

Is there any way to retain the value of the variables....?

I cannot use the hash files to this job though it works perfectly fine, due to performance issues.

Thank You.
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

Hi

With the Stage Variable it should work. I think you are having a logic mistake in that job.

Inside your transformation for assiging stage variable then you should see that its value are correct. From the input file pick up the correct header record and pass it to the stage variable. (ie. If record_type = 'Header' then Stage_Variable1 = Column1 Else Stage_Variable1)

Try this it will work

Cheers
Siva
Post Reply