Nicki: perhaps an idea would be to always make your identifiers text fields, even if they are numbers. If you nevertheless like to enter this particular field as a number, you could create a second field that takes the number and converts it into a text field with the desired leading zeros:
In the QES file:
vartxt ____ varnum ####
In the CHK file:
vartxt NOENTER END
varnum MUSTENTER AFTER ENTRY varntxt=varnum IF varnum<1000 THEN vartxt="0"+varnum ENDIF IF varnum<100 THEN vartxt="00"+varnum ENDIF IF varnum<10 THEN vartxt="000"+varnum ENDIF END END
Hans
epidata-list@lists.umanitoba.ca wrote:
<div class="moz-text-flowed" style="font-family: -moz-fixed">Dear All,
I apologise if this question is simple but I really can't figure it out.
In creating my chk file, I need to ensure that four of the variables contain a certain number of digits. I know this is normally controlled by number fields the .qes file. However, in this instance I need zeros to be included at the beginning (eg. 0003) so that all responses contain the same number of digits. This is because I will be putting these 4 variables together to create a 10 digit identifier later in the chk file.
At the moment, whenever I enter 0003, the zeros are removed and I am left with just 3.
Does anyone know if there is a way to ensure the zeros remain, and to ensure that each variable entered contains 4 digits?
Many thanks in advance for your advice!
Nicki