counter needs to be incremented by 1 with exactly 6 digit

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
pongal
Participant
Posts: 77
Joined: Thu Mar 04, 2004 4:46 am

counter needs to be incremented by 1 with exactly 6 digit

Post by pongal »

I want to generate a sequence number starts from 000000 and increment by 1 for each load.
for eg:- if source contains 1000 records for first load,
sequence number should start from 000001 and ends at 001000.
for second load, if source contains 2000 records,
then sequence number should start from 001001 and ends at 003000.
is there any readymade function that we can use or do i need to write a code in server routine?

Thanks in advance
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Pongal,

you could write a function that returns the number of rows processed in the last run of a job, use the DSGetLinkInfo() routine and give it the stage and link name and it can return the number of rows processed. This number can then be used to update either a Hashed file or a table with the new sequence starting number.
pnchowdary
Participant
Posts: 232
Joined: Sat May 07, 2005 2:49 pm
Location: USA

Post by pnchowdary »

Hi Pongal,

Alternatively, you can always store the number of rows read from source in a sequential file and read the file in a before job routine and populate your sequence number accordingly.
Thanks,
Naveen
elavenil
Premium Member
Premium Member
Posts: 467
Joined: Thu Jan 31, 2002 10:20 pm
Location: Singapore

Post by elavenil »

Hi Pongal,

You can also store the last seq number for each load and increment from that seq number in the next load.

Regards
Saravanan
Post Reply