Hi,
What function can i use to display the duplicate household head name but different case id? This is a batch editing application.
For example.
140012
HHHead Name: Joe Coe
140013
HHHead Name: Joe Coe
Thanks. In advance
Duplicate Household Head Name
-
- Posts: 1853
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Duplicate Household Head Name
How about using the HashMap object: https://www.csprousers.org/help/CSPro/HashMap.html
Something like:
Something like:
HashMap string hhNames(string);
if hhNames.contains(HH_NAME) then
errmsg("'%s' already encountered in case '%s'", HH_NAME, hhNames(HH_NAME));
else
// associate the household name with the case ID
hhNames(HH_NAME) = key(DICT_NAME);
endif;
if hhNames.contains(HH_NAME) then
errmsg("'%s' already encountered in case '%s'", HH_NAME, hhNames(HH_NAME));
else
// associate the household name with the case ID
hhNames(HH_NAME) = key(DICT_NAME);
endif;
Re: Duplicate Household Head Name
Thanks, the code is working.
Additionally i want to printout the age of John in case 140013, it should appear in 140012 errror message, how can i do this?
errmsg("'%s' already encountered in case '%s'", HH_NAME, hhNames(HH_NAME));
Case [140012] has 1 messages (0 E / 0 W / 1 U)
U -'Joe Coe' already encountered in case 140013
Additionally i want to printout the age of John in case 140013, it should appear in 140012 errror message, how can i do this?
errmsg("'%s' already encountered in case '%s'", HH_NAME, hhNames(HH_NAME));
Case [140012] has 1 messages (0 E / 0 W / 1 U)
U -'Joe Coe' already encountered in case 140013
-
- Posts: 1853
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Duplicate Household Head Name
You can use the same idea of storing the name, but also have a variable with the ages.
HashMap numeric hhAges(string);
// ...
errmsg("'%s', aged %d, already encountered in case '%s'", HH_NAME, hhAges(HH_NAME), hhNames(HH_NAME));
// ...
errmsg("'%s', aged %d, already encountered in case '%s'", HH_NAME, hhAges(HH_NAME), hhNames(HH_NAME));