?? Loop Through File & Modify Fields ??

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
tonystark622
Premium Member
Premium Member
Posts: 483
Joined: Thu Jun 12, 2003 4:47 pm
Location: St. Louis, Missouri USA

Post by tonystark622 »

Raggy,
On the Sequential File stage where you are writing the data out, do you have the "Update Action" set to "Overwrite existing file" or "Append to existing file"?

Also, you may want to land the data in another sequential file, then delete the original and rename the file you wrote to the original name. Just a suggestion.

Let us know what fixes it[:)]

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

Post by chulett »

You can't "update" a sequential file in DataStage, even when using BASIC. You'll need to do as Tony suggests and write the changes out to a new file. Then once complete, you can play musical filenames and rename them as you see fit.

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

Post by chulett »

Depends on your operating system, as that is what you'll need to use. Either write a script that takes appropriate parameters and run that or execute the o/s "mv/ren" command directly.

In either case, look up DSExecute.

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

Post by ray.wurlod »

Just to tidy this one up, you CAN update sequential files with DataStage BASIC, but the filepointer must be manipulated exactly (using SEEK, and the FILEINFO function to determine position to which to return) and the line length cannot be changed.
The two file approach is definitely better.

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
Post Reply