How to store user input prompt in SAS EG? - sas

I am using SAS EG 7.1, have created few macro prompts in the project. However, I am having some difficulty to store user input of prompt in the project. Any idea on how to do it? Much thanks.

Prompts are global variables in the Sas EG session. Once the user sets them with s value, they will retain their value until modified. you can attach the prompts to things in the process flow in the properties window of that item.

Related

Take user input to complete missing values

I need some sort of guidance on what would be the best way of accomplishing such kind of task in SAS EG environment (on a 9.4 server). Let's say I have table named ITEM_EVALUATION like in the following example. The missing evaluations (rows: 4,5 and 6) should be filled in by the user. Although there may be better solutions, I would prefer if SAS iterated over the missing rows, give the user the row information (item) and take the input (evaluation) then update the table by that input.
Since this task is going to be a part of another sas eg project (egp), I need to do it within this project, so please advise...
ITEM_EVALUATION.sas7bdat
ROW
ITEM
EVALUATION
1
car
owned
2
house
rent
3
cat
none
4
phone
5
job
6
vacation
7
Make sure your dataset occurs in your project. (Drag it to a flow, for instance.)
Ask your user to double click any empty cell in the table and accept to go to edit mode.
If the empty cells are rare, the user can enter a filter missing(ITEM) or missing(EVALUATION) on top of the data to find them.
If that is too complex for your user, Enterprise Guide is not the tool for this person.

Power BI report based on user input

I am trying to get a report to display results based on the input of the user. This will be used online by the user not in the desktop app so we cannot use a parameter. Also need to be able to change input as needed. What we are looking for is not to show any data at all in a table until the user inputs the username to lookup. Think of it like the way a slider acts, but only using the search box. we do not want to show the list of usernames, the user must already have that information. So the main thing is show nothing until input is made, once made show username information (statistics).
Is this possible?

SAS - Overwriting a dataset open in ViewTable

Is there a way to replace a data set which is currently open in the ViewTable Window?
For example, say I create the following data set:
data the_meaning_of_life;
is = 2;
run;
I open it up and notice, oh drat!, I made a typo! I correct the code and rerun it.
data the_meaning_of_life;
is = 42;
run;
I'm then met with the following message,
ERROR: You cannot open WORK.THE_MEANING_OF_LIFE.DATA for output access with member-level
control because WORK.THE_MEANING_OF_LIFE.DATA is in use by you in resource environment
ViewTable Window.
Of course there are workarounds. In the keys menu, I could bind
next viewtable:libref.dataset;end;
to an F key or prefix the submit button with it so that all VTs are closed before code is submitted.
I recognize that there's an assumption I'm making. I'm assuming that because the ViewTable Window is called a "ViewTable" that it is indeed a view.
According to SAS, a view is
a definition of a virtual data set that is named and stored for later
use. A view contains no data; it merely describes or defines data that
is stored elsewhere.
A view should be independent of the data set. It seems like the ViewTable opened when a data set is double-clicked in the SAS Explorer is not a 'true' view. So maybe my question should be revised to,
How do I view a data set as a view?
You view a dataset as a view by creating a view and then opening it. But you have a misapprehension of what a view is; specifically, a view can lock a dataset, if it's set up to do so (in some DBMSs), while it's operating. (More on that later.)
SAS is locking the dataset, not because it has to, but because it is the right thing to do here given how it works. When dealing with the issue of "How do you handle a viewtable window when the underlying dataset is modified", you have three choices, right (maybe four)?
Disallow changes
Update the viewtable to reflect the changes
(maybe) Indicate to the user that it needs to be refreshed
Ignore the changes, let the user have out of date information
ViewTable is a concept that's quite old - and uses pretty old methods. As such, the second choice isn't really possible - it's not something running in a way that can update in real time. The third isn't really either: it again would require SAS knowing that the change happened and having the ability to update the ViewTable window, which it doesn't currently do. Right now, ViewTable just grabs the data and shows it to you, and then never checks back. And option 4 is bad because you now have the user being confused as to what "true" is, especially since ViewTable actually allows for direct editing of the data (this is never something I would do, but it is possible!).
Hence SAS goes with option 1: lock the table from any changes, so you know you have the current information.
Also, a side note; ViewTable is an AF application, it isn't actually a View. ViewTable means "view a table", not "make a view from a table".
As to how you can handle this: writing a view won't help, unfortunately. Note this:
data class;
set sashelp.class;
run;
data class_view/view=class_view;
set class;
run;
Run that, open the view, then rerun the first data step. Yep, you still have it locked! That's because opening the view actually tells SAS to lock the dataset(s) that the view uses, for the same reason as above.
What you can do though:
data class;
set sashelp.class;
run;
proc print data=class;
run;
You can run that all day and it won't have any issue, since the proc print is just a static "view" that doesn't lock anything.
You can also use ODS TAGSETS.TABLEEDITOR, which gives you something a little more useful perhaps.
You can definitely use the keys options to close your tables. Better perhaps is to use Enterprise Guide, which has a nice option that tells EG to close all open datasets before running anything.

How to add prompt code into othere code in sas?

I have created Date prompt in SAS EG "Start_DT" & "END_DT" now I want to pass this user defined values from other programe?
I have link this two program (Prompt + Program) but not able get pass the values of Prompt..
Thanks in Advance..!
Edit your prompts and tick the box "Use prompt value throughout project" - that will make your macro variables global.

In enterprise guide, how do you re open a previous data steps output to view it?

I'm using enterprise guide 4.3.
When you run a data step the resulting output opens in a spreadsheet like table.
Then when you run a proc tabulate or similar, the spreadsheet like view of the data disappears and the table comes up in SAS Report or HTML form etc.
You can then run further commands on that dataset that was created in the data step.
Q. How can you get that spreadsheet like view of the dataset back? (assuming it's possible)
I know you can run the data step again and it will display it but that seems really inefficient, especially if the data step had lots of computations involved. The data is obviously 'sitting there' given you can still interact with it (with proc tabulate etc). I was really surprised to see that it drops off from the process flow view.
Apologises if I've name things poorly above, I'm an R beginning to dabble in SAS.
If I understood you correctly you run some code and the result comes up. Then you run some other piece of code, from the same Code node and the initial result gets removed from the process flow.
You can always find your dataset in the Server List. You can enable it by clicking View -> Server List.
There is also a trick that you can do. When you run your code and the dataset node is created in the process flow, you can do a simple query on it. Just do Right click -> Filter and query and make it do something simple that won't take too long.
Now, when you run your next piece of code, this node will not be replaced (at least this is what happens in EG 4.1).
If you mean viewing the resulting data set from a DATA STEP, choose View/Process Flow and double click on the data set you want to view. Also, within your program, log, data or result view, there should be tabs across the top that allow you to bring up the other items of the process flow.