Page 1 of 1

occurs item inside a multiple occurring record

Posted: July 27th, 2018, 7:20 pm
by AriSilva
I´m trying some editing on a variable which is a subitem (e18) of an item that occurs 3 times. The item belongs to a record type with a max of 20.
I´m inside of that proc e18
The checking works fine, the errmsg also, but when I try to impute the field it does something which I do not know, and change the original value to default.
I´ve tried using the full index system, such as
e18(curocc(rec),curocc(item))
but nothing seems to work.
Apparently I´m doing something very wrong but I cannot catch it.

Re: occurs item inside a multiple occurring record

Posted: July 29th, 2018, 3:08 pm
by josh
If you have a numeric parent item you can run into problems with subitems if blanks or non-numeric characters are introduced into the parent item. Make sure the parent item is alpha.

If that isn't the problem please send us a test app so we can reproduce.

Re: occurs item inside a multiple occurring record

Posted: July 30th, 2018, 4:13 pm
by AriSilva
Attached the test app.
Plz, execute first the TesteE18.pff which will generate an output file, then execute the TesteE18_Segunda.pff which is the same program reading the output file. You will see that all the variables have default values thatwere not there at the beginning.
Best

Re: occurs item inside a multiple occurring record

Posted: July 30th, 2018, 7:40 pm
by josh
The dictionary file is missing from the app you attached.

Re: occurs item inside a multiple occurring record

Posted: July 31st, 2018, 7:30 am
by AriSilva
My mistake.
I did not test it throughly before sending. Sorry.
Here it goes

Re: occurs item inside a multiple occurring record

Posted: July 31st, 2018, 4:33 pm
by josh
Try making the parent item E18_VIAGENS type alpha. CSPro often runs into problems with numeric items that have subitems. When the subitems are blank it messes up the item.

Re: occurs item inside a multiple occurring record

Posted: July 31st, 2018, 6:21 pm
by AriSilva
You are right (as always).
I´ve changed the item group to alpha and the program worked.
I would suggest writing something about that in the help when using subitems, if it is not there already.
Thanks