Page 1 of 1

Cannot include multiple variables in selcase function

Posted: March 17th, 2021, 6:56 am
by manishcspro
The selcase function can only include single variable.
how can I include multiple variables in Selcase function from external dictionary.
Please help me.

Re: Cannot include multiple variables in selcase function

Posted: March 17th, 2021, 7:22 am
by josh
You can include multiple variables with the include clause:

Code: Select all

selcase(OCCUPATION_DICT, "Plantation") include(OCCUPATION_CODE,OCCUPATION_SUMMARY_LEVEL);

Re: Cannot include multiple variables in selcase function

Posted: March 17th, 2021, 7:47 am
by manishcspro
It is to be clarified that I want to include variables with multiple occurrences.
I want to display dynamic values of a variables based on values of variable from external dictionary.
Please help me.

Re: Cannot include multiple variables in selcase function

Posted: March 17th, 2021, 8:08 am
by josh
What exactly do you want to do? Maybe there is a different function that would help.

Re: Cannot include multiple variables in selcase function

Posted: March 17th, 2021, 8:32 am
by manishcspro
I have created an application to collect data of monthly progress of items of various sectors on monthly basis.
The value of each item of a sector is entered from April to March for a financial year.
I want to display the previous month's value for each item before keying in the current month item.
The application reads the previous month data from external data file created by data entry application using Writecase function.

I thought that the value of previous month's data of particular item of the particular sector will be displayed while entering in current month.
But it displays only the value of first item while moving on another item.
Please guide..


My particular code :

function OPTION()
open(CASELIST_DICT);
locate(CASELIST_DICT,=,"");
do I = 1 while I <= count(ACH_DICT.ACH)


CaseFound = selcase(CASELIST_DICT,"")
where ACH_MTH IN "05" AND MTH_LIST="04" AND YR_LIST=ACH_YR AND DIST_LIST=DIST AND DEPT_LIST=DEPT AND CASELIST_ITEM(I)=ACH_ITEM(I)
include(DEPT_LIST, CASELIST_ITEM, CASELIST_MP, CASELIST_CP);

enddo;
end;

Re: Cannot include multiple variables in selcase function

Posted: March 17th, 2021, 9:02 am
by josh
I would implement this using forcase with a where clause to find the appropriate cases in the data file and then display the result using errmsg or a dynamic value set.

Re: Cannot include multiple variables in selcase function

Posted: March 22nd, 2021, 6:07 am
by manishcspro
The forcase with find works but it displays all the item values at a time.
I want to display only the previous months value of particular item before reaching at the current month's item,
but it shows the previous month's value of first item when I reach at first item then
it shows the previous month's value of first and second item when I reach at second item then
it shows the previous month's value of first, second and third item when I reach at third item an so on.

Please guide me so as to find my solution.

Re: Cannot include multiple variables in selcase function

Posted: March 24th, 2021, 9:08 am
by Gregory Martin
Perhaps you can send your application to cspro@lists.census.gov. It's a bit hard to understand your application without seeing the code.

Forcase allows you to look at all cases, or a subset of cases using the where clause, so it should work as long as your code that determines when to stop processing cases is correct.