File Writing Limitations

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
hemant
Participant
Posts: 67
Joined: Mon Dec 15, 2003 6:43 am

File Writing Limitations

Post by hemant »

Hi All,

I'm really facing serious issues while confronting with the file writing limitations of the DataStage routines. Actaully i want to write a transform routine for Routine Activity which will be called in Sequencer and will append the user supplied information through arguments to the existing information file.

I couldn't find any specific way to go about appending the contents to the data file through routine. The WRITESEQ statement overwrites the existing file which is not required.!

Any information or help regarding this..?? A million dollar question, Does the routine functionality is really limited in this case?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Hemant,

you haven't confronted any file writing limitations in DataStage routines in this case.

When you OPENSEQ a sequential file the file pointer is positioned at the beginning of the file. If you start writing to the file then you are going to overwrite your data and then truncate it when you close the file.

In order to append to a sequential file you first need to position the current file pointer to the end of the file, you do this using the SEEK command which is documented in the DataStage BASIC handbook.

Alternatively (and a route I recommend), you should use the handy routine written by Ray Wurlod and posted here
clshore
Charter Member
Charter Member
Posts: 115
Joined: Tue Oct 21, 2003 11:45 am

Post by clshore »

Are you writing a routine just so you can append?
Otherwise, use a Sequential file stage, and click 'Append to existing file' on the Inputs tab.

Carter
Post Reply