Strange values in skipped variables

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
Enkhbayar
Posts: 68
Joined: November 10th, 2014, 11:48 pm

Strange values in skipped variables

Post by Enkhbayar »

Hi all,

I have a strange issue. Seems like a bug. version is 7.6.2

It's multi answer question. So, I apply values on the fly into binary variables as below. it works ok unless this variable was skipped. The issue is I have strange values in some cases after the whole section was skipped. Cases were completed and closed properly. See the screenshot from the attachment.

Does anyone have any idea?

Code: Select all

PROC C11
postproc
if length(strip($))=0 then
	reenter;
endif;
if pos("A", $) > 0 then	C11_1=1; else C11_1=2; endif;
if pos("B", $) > 0 then	C11_2=1; else C11_2=2; endif;
if pos("C", $) > 0 then	C11_3=1; else C11_3=2; endif;
if pos("D", $) > 0 then	C11_4=1; else C11_4=2; endif;
Attachments
2021-09-14 (6)_LI.jpg
2021-09-14 (6)_LI.jpg (598.56 KiB) Viewed 1632 times
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Strange values in skipped variables

Post by sherrell »

> The issue is I have strange values in some cases after the whole section was skipped.

When you say strange values, do you just mean you have values in the fields? i.e., in the screen shot you provided, 1 and 2 are anticipated values. So, the fields do not contain garbage/other values.

Without seeing your application we can't test this. We have not received any reports of problems. If you don't mind posting your application here, please do. If you don't wish to make your application public, then you can mail it to us at cspro@lists.census.gov.

Also, I'm not sure if you've seen the isChecked function, but it is a handy tool for what you're doing. Instead of writing
if pos("A", $) > 0 then C11_1=1; else C11_1=2; endif;
you would write this:
if ischecked("A", $) then C11_1=1; else C11_1=2; endif;
For this to work the capture type for C11 would have to be "Check Box". This also saves you having to check whether the person entered A, B, C, or D more than once.

Sherrell
Enkhbayar
Posts: 68
Joined: November 10th, 2014, 11:48 pm

Re: Strange values in skipped variables

Post by Enkhbayar »

Thanks Sherrell for your reply,

- the capture type for C11 is "Checkbox"
- the same result I have with ischecked function
- strange means: I have values in some skipped variables (not all)

I will send you the app

Thanks,
Enkhbayar

sherrell wrote: September 14th, 2021, 12:33 pm > The issue is I have strange values in some cases after the whole section was skipped.

When you say strange values, do you just mean you have values in the fields? i.e., in the screen shot you provided, 1 and 2 are anticipated values. So, the fields do not contain garbage/other values.

Without seeing your application we can't test this. We have not received any reports of problems. If you don't mind posting your application here, please do. If you don't wish to make your application public, then you can mail it to us at cspro@lists.census.gov.

Also, I'm not sure if you've seen the isChecked function, but it is a handy tool for what you're doing. Instead of writing
if pos("A", $) > 0 then C11_1=1; else C11_1=2; endif;
you would write this:
if ischecked("A", $) then C11_1=1; else C11_1=2; endif;
For this to work the capture type for C11 would have to be "Check Box". This also saves you having to check whether the person entered A, B, C, or D more than once.

Sherrell
Post Reply