Page 2 of 2

Posted: Thu Sep 13, 2007 3:18 pm
by ray.wurlod
Sort by Inv and Rec Type. The rest follows easily, particularly if you have the Sort stage generate Key Change column.

Posted: Thu Sep 13, 2007 3:23 pm
by edward_m
ray.wurlod wrote:Sort by Inv and Rec Type. The rest follows easily, particularly if you have the Sort stage generate Key Change column.
Ray..
I can't sort ..because these are header and trailer records.There is one more data column attached to each and every record.

Posted: Thu Sep 13, 2007 5:11 pm
by chulett
So... you don't feel comfortable enough with the concept of stage variables to adapt the code for this 'new' requirement, so didn't try? Or you've tried and couldn't make it work?

Posted: Thu Sep 13, 2007 5:44 pm
by edward_m
Chulette,

I tried in different ways and i didn't get the correct output..
Any help on this would be appreciated

Posted: Fri Sep 14, 2007 7:21 am
by edward_m
chulett wrote:So... you don't feel comfortable enough with the concept of stage variables to adapt the code for this 'new' requirement, so didn't try? Or you've tried and couldn't make it work?
Chulette..
I am fully not understand stage variable..if i am not asking too much then could you please give me the code for this also.
Thanks in advance

Posted: Fri Sep 14, 2007 11:36 am
by shepli
Input: InvNo and RecType

Create 3 stage variables:
svNewInvNo (init val=""): If input.InvNo=svInvNo Then 0 Else 1
svInvNo (init val=""): input.InvNo
svSeqNo (init val=0): If svNewInvNo Then 1 Else (If input.RecType="605" Then svSeqNo+1 Else svSeqNo)

Output: InvNo = input.InvNo
RecType = input.RecType
SeqNo = svSeqNo

Hope this works for you.

shepli

Posted: Fri Sep 14, 2007 12:52 pm
by edward_m
shepli wrote:Input: InvNo and RecType

Create 3 stage variables:
svNewInvNo (init val=""): If input.InvNo=svInvNo Then 0 Else 1
svInvNo (init val=""): input.InvNo
svSeqNo (init val=0): If svNewInvNo Then 1 Else (If input.RecType="605" Then svSeqNo+1 Else svSeqNo)

Output: InvNo = input.InvNo
RecType = input.RecType
SeqNo = svSeqNo

Hope this works for you.

shepli
Shepli..Thanks for your reply.
Could you please suggest me the code for my previous post..510 and 520 records

Posted: Fri Sep 14, 2007 11:41 pm
by DSguru2B
edward_m, there are several codes provided by our posters. Shepli gave you code for each scenario. See what works and if you are not getting the desired result, let us know what output you are getting for what code.