Cannot include multiple variables in selcase function

Discussions about CSEntry
Post Reply
manishcspro
Posts: 33
Joined: June 26th, 2017, 2:15 pm

Cannot include multiple variables in selcase function

Post by manishcspro » March 17th, 2021, 6:56 am

The selcase function can only include single variable.
how can I include multiple variables in Selcase function from external dictionary.
Please help me.

josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Cannot include multiple variables in selcase function

Post by josh » March 17th, 2021, 7:22 am

You can include multiple variables with the include clause:

Code: Select all

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

manishcspro
Posts: 33
Joined: June 26th, 2017, 2:15 pm

Re: Cannot include multiple variables in selcase function

Post by manishcspro » March 17th, 2021, 7:47 am

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.
Last edited by manishcspro on March 17th, 2021, 8:13 am, edited 1 time in total.

josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Cannot include multiple variables in selcase function

Post by josh » March 17th, 2021, 8:08 am

What exactly do you want to do? Maybe there is a different function that would help.

manishcspro
Posts: 33
Joined: June 26th, 2017, 2:15 pm

Re: Cannot include multiple variables in selcase function

Post by manishcspro » March 17th, 2021, 8:32 am

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;

josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Cannot include multiple variables in selcase function

Post by josh » March 17th, 2021, 9:02 am

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.

manishcspro
Posts: 33
Joined: June 26th, 2017, 2:15 pm

Re: Cannot include multiple variables in selcase function

Post by manishcspro » March 22nd, 2021, 6:07 am

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.

Gregory Martin
Posts: 1475
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Cannot include multiple variables in selcase function

Post by Gregory Martin » March 24th, 2021, 9:08 am

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.

Post Reply