BookmarkSubscribeRSS Feed
GuiVtzl
Fluorite | Level 6

Hi everyone,

I have a little (in fact, it's big) problem.

Here's a table :

prompt.jpg

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

8 REPLIES 8
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

GuiVtzl
Fluorite | Level 6

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 ?

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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:

SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition

http://www2.sas.com/proceedings/sugi27/p192-27.pdf

Sorry, I can't be more helpful than that.

Cynthia_sas
SAS Super FREQ

Hi,

  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.

cynthia

Haikuo
Onyx | Level 15

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 Smiley Happy.

Haikuo

GuiVtzl
Fluorite | Level 6

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 !

Thanks

SASKiwi
PROC Star

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 Smiley Wink. You can use it with the SAS Add-in to directly read or update SAS datasets.

Fugue
Quartz | Level 8

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 1245 views
  • 0 likes
  • 6 in conversation