Sequence no's

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
naren6876
Participant
Posts: 233
Joined: Mon Feb 07, 2005 7:19 pm

Sequence no's

Post by naren6876 »

Hi,
Last edited by naren6876 on Tue Mar 01, 2005 7:19 pm, edited 1 time in total.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Assuming your input record is called MyRecord, you can define a stage variable MySeqNo and set default to 0.

In the derivation for this stage variable, enter

If MyRecord[26, 1] = 'P' Then MySeqNo + 1 Else MySeqNo

In the output column derivation, add a 3 field char in the front and in its derivation enter

Fmt(MySeqNo, "3'0'R")

Alternatively if the output is single column / field, enter

Fmt(MySeqNo, "3'0'R") : MyLink.MyRecord

I believe I had replied similar post before and hence it may be better to search the forum before posting new ones to save your time.
srikie
Participant
Posts: 58
Joined: Thu Oct 14, 2004 4:19 pm

Re: Sequence no's

Post by srikie »

use keymgmtget next value function to generate the sequence number and character matching can b done using the substring function. hold sequence number in a stage variable so that it cud b copied until the next string with p occurs.
Post Reply