Page 1 of 1

Assigning SEQNUM on set of records.

PostPosted: Fri Oct 03, 2008 6:09 pm
by ranga_subham
Hi,

Say, a file has input records like this :

1111abc
1111bcd
1122abc
1122bcd
1122cde


Is it possible to assign the SEQNUM as shown below?

1111abc    1
1111bcd    2
1122abc    1
1122bcd    2
1122cde    3


Please suggest.

Thanks.

Re: Assigning SEQNUM on set of records.

PostPosted: Wed Oct 08, 2008 8:51 pm
by Alissa Margulies
Try this:
//SYSIN DD *
   SORT FIELDS=(1,7,CH,A)                         
   OUTREC FIELDS=(1,7,12:SEQNUM,1,ZD,RESTART=(1,4))
/*

Re: Assigning SEQNUM on set of records.

PostPosted: Mon Oct 13, 2008 3:47 pm
by ranga_subham
It does not work the way I expected..........It is assigning 1 to all the records !

Any other alternative please?

Thanks.

Re: Assigning SEQNUM on set of records.

PostPosted: Mon Oct 13, 2008 7:19 pm
by Alissa Margulies
Did you try with the sample data you provided in your previous post, or with different test data? I ran with your exact data above and got the expected output.

Re: Assigning SEQNUM on set of records.

PostPosted: Mon Oct 13, 2008 9:05 pm
by ranga_subham
Alissa, my apologies........ :(

I did not change it from INREC to OUTREC and that is why I wasn't getting the result.......... :mrgreen:

Thanks a lot..........cool.