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.
Related
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.
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.
I am a beginner at AppleScript so I really don't know a lot. I have been trying to make the user select from a list of situations and then based on what they choose have an appropriate response. However, I have run into a few problems:
The script runs but doesn't display the notification.
Is there a better way than just chaining a lot of IF statements?
PS: I am nowhere near finishing this whole script.
on run
choose from list {"Thunderstorm", "Flood", "Heatwave", "Hazmat"} with prompt "Please select one of the emergency situations below" without multiple selections allowed and empty selection allowed
return the result as string
if string is Thunderstorm then display notification "hello"
end run
You made some pretty good guesses about what the sample code you were looking at does; but some of those guesses were wrong. With time you’ll get a better feel for how AppleScript works.
You have the situation names entered correctly as strings in the choose from list line, by surrounding their text with quotes. But in the check to see whether it’s a thunderstorm, you do not surround that text with quotes. AppleScript is looking in a variable called Thunderstorm for its contents, not looking at the string of text “Thunderstorm”.
return the result as string does not create a variable called string but rather ends the handler called run, returning the result to whatever code called run, as a string of text. To assign the result of choose from list to a variable, use something like set theSituation to the result as string.
Here’s an example of how your code might work better:
on run
--get the situation we're dealing with
choose from list {"Thunderstorm", "Flood", "Heatwave", "Hazmat"} with prompt "Please select one of the emergency situations below" without multiple selections allowed and empty selection allowed
copy the result as string to theSituation
--Thunderstorms require that the user be immediately notified
if theSituation is "Thunderstorm" then display notification "hello"
end run
Since you have this as a run handler, you probably don’t want to return any result, as you rarely call run handlers. But if you do need to return the result, the last line of the handler (just before end run) would be:
return theSituation
You might look around for an AppleScript tutorial that fits your needs. Apple has their Introduction to AppleScript Language Guide.
IF statements can be chained using if/else if/else if:
on run
--get the situation we're dealing with
choose from list {"Thunderstorm", "Flood", "Heatwave", "Hazmat"} with prompt "Please select one of the emergency situations below" without multiple selections allowed and empty selection allowed
copy the result as string to theSituation
--Thunderstorms require that the user be immediately notified
if theSituation is "Thunderstorm" then
display notification "hello"
else if theSituation is "Flood" then
display notification "hike pants"
else if theSituation is "Heatwave" then
display notification "Play Bing Crosby"
else if theSituation is "Hazmat" then
display notification "Use highway 183"
end if
end run
There is no switch/case control structure in AppleScript.
I am interested in if there is a mean to indicate where the writing the variable name should start
e.g if I call this live template:
console.log('$TEXT$', $TEXT$);
^
It will start writing from the first TEXT variable.
I want to start writing from the second one:
console.log('$TEXT$', $TEXT$);
^
Indicate the order of focusing the same variable
You cannot do that: each variable is processed only once.
The solution is to apply a simple workaround: create an additional/intermediate variable that will automatically get the same value from the first variable and arrange them in the desired order.
Create a new variable and give it different name (e.g. $VAR$):
console.log('$TEXT$', $VAR$);$END$
NOTE: I've also added $END$ to denote final cursor position
Click on the Edit variables button.
Rearrange variables in desired order (using Up / Down buttons on the right side).
Assign default value for TEXT variable: make it to accept the value that you will enter for VAR variable.
Also check the Skip if defined checkbox if you do not plan to edit the TEXT value while filling the variables.
Result: only 1 place to enter variable name (code completion is available if needed) and the entered value is automatically copied into the text field (which you can still edit later once you're done with expanding the template).
Related StackOverflow questions:
WebStorm - Live templates - indicate the order of focusing the same variable
WebStorm JavaScript live template - deciding where the cursor will be
I am making a script to detect a date picker and select some date from it. The issue is that my date picker has id which changes randomly and is auto generated. When i rerun the script it gives the error that object not found since date picker id is changed. Class name for my date picker is also not constant, the only thing constant is name.
Please help me how can i detect an object using name of the element or how can i pass my dynamically changing id of the element to my macro for my script to run successfully.
http://imacros.net/best-practices-of-using-imacros-for-test-automation
1 Handling Dynamic IDs
Use Wildcards
If you replace the numbers of the ID with the * wildcard, the macro will be successfully executed in every browser session.