Page 1 of 1
Duplicate serial number
Posted: July 27th, 2017, 7:51 am
by Tsheringcee
Is it poosible to put a check in a batch editing program to check for any duplicate serial number in a roster entered by the keyer during entry
Thanks
Tshering
Re: Duplicate serial number
Posted: July 27th, 2017, 8:35 am
by josh
You could use the count function with "where" to get the number of rows in the roster with the same serial number as the serial number of the current row. Something like:
PROC SERIAL
if count(MYROSTER000 where SERIAL = SERIAL(curocc())) > 1 then
errmsg("Duplicate serial number");
endif;
Here serial(curocc()) is the serial number of the current row so the count() will return the number of rows whose serial matches the one that was just entered. If the result is greater than 1 then this is a duplicate.
Another option is to set the SEQUENTIAL property on the serial field and have CSEntry fill it in automatically. If you do this you can also make the field protected so that the user cannot change it. That way you can never duplicate serial numbers.
Re: Duplicate serial number
Posted: July 27th, 2017, 11:31 pm
by Tsheringcee
Thank u so much