06-18-2014 08:45 AM
I have a little (in fact, it's big) problem.
Here's a table :
I'd like to find a way, with a prompt, to "manually" fill the FLAG variable.
Basically, I'd like, for each line, to be asked via a prompt to choose if I put "1" or "0" for FLAG variable.
It must be manual (i.e. the user must decide manually on each line). I know I can modify directly the set and write 1 or 0, but to be honest, my boss insists for it to be via a prompt.
Is it possible ?
Thanks a lot
06-18-2014 08:54 AM
I don't use EG, so there maybe a solution. In my opinion though data entry, which is what we are talking about, is on real failing with SAS. There is AF/SCL to build forms but its really clunky. Table entry is painful when doing more than one cell. I would suspect this is why most people would use Excel (though it pains me to say it), set a Data Validation on that column in Excel so only 0 or 1 can be entered, maybe protect all other cells. Then ask them to fill that in and return it to you for importing.
06-18-2014 09:00 AM
Thank you RW9,
I thought about something similar (much less well-said than the way you did ahah) but I gonna be honest, my boss is really stubborn, and he wants it in EG only.
So you're telling me there is probably no way to do that ?
06-18-2014 09:18 AM
Well, I don't use EG so don't know it that well - others con comment on that. The only other thing I can think of from a Base SAS point of view is window statements:
Sorry, I can't be more helpful than that.
06-18-2014 09:46 AM
But, %WINDOW statements may not work with EG, since all the EG-generated code is submitted to SAS on the server in batch mode. I thought that %WINDOW required interactive mode.
06-18-2014 09:37 AM
Ok, I am an EG user. But first let me ask you, what is the bigger picture here? what is the purpose of doing it? If you have business rules, then apply it using SAS code; if it is purely arbitrary, then I don't see the difference between a random (0,1) assignment, which can also be done using direct code? If what you want is to let uses to see the data first before choosing a prompt, then I can't envision anything conventional.
Prompts, by its nature, are macro variables, which are settled before SAS code touches data, meaning in most of cases, they are used to set the conditions or redirect the code execution, not for inputing data. Please share more context so we can help you with your little/big problem as well as your boss .
06-18-2014 11:19 AM
Yeah that's right !
In fact I got that data set prior in my study. Later we receive a list of "contracts" for which we need to put provisions (sorry my english is bad). But the problem is, I have no key to match the two lines since the amounts differ so we have to do that "manually".
But yeah that's what I told my boss (that it was impossible) so now I am sure !
06-18-2014 04:13 PM
If you were using "traditional" SAS there would be many options for data entry: %WINDOW, WINDOW, FSEDIT, FSVIEW, SAS/AF and SCL.
With EG all of those options are not possible because EG runs SAS in batch mode. Instead you have Process Flow prompts which are for controlling your EG jobs, not for data entry, You can use the EG table viewer in update mode to change data in a dataset but as already described it is designed more as a data viewer not for data entry.
You could build an EG custom task to do what you want but you would have to learn .NET and write many lines of .NET code to do what is really a very simple task - See SAS Dummy posts.
Excel isn't a bad option and at least it doesn't involve extra coding . You can use it with the SAS Add-in to directly read or update SAS datasets.
06-18-2014 04:19 PM
A simple workaround might be to set the flags in Excel (you can set Data Validation in Excel to only accept 0 or 1 as a precaution), import the workbook into your EG project and merge with your dataset to pick up the flag.