BookmarkSubscribeRSS Feed
DOBBINHO
Obsidian | Level 7

Hello all,

 

I went through the available resources to learn about the PMENU procedure. But I haven't really been able to figure out how to configure dialog boxes to take in user input and put it into a dataset. I know that we need to specify a command string to define what the dialog is meant to do with the user input. In the SUGI paper from http://www.sascommunity.org/sugi/SUGI94/Sugi-94-248%20Staum%20Staum.pdf I observed a sample command string to be dialog detlinfo 'end;include rptcode(detail);c xx @1;submit';

Frankly I didn't understand it at all. Now I am trying to make my own utility of sorts in order to take in 4 variables through dialog boxes.

And I am unsure of what needs o be input in place of the command string to get the input from the user and input it into one dataset.

My program is as follows:

 

libname prith '/home/dubby';

proc pmenu catalog=prith.menus;

menu BASE;

item 'Enter parameters' menu=parameters;
item 'Bye';
menu parameters;
item 'Study' Dialog=study Help='Enter the Study';
item 'Study' Dialog=dbl Help='Enter the Database Lock date';
item 'Study' Dialog=lckdt Help='Enter the Lock request date and time';
item 'Study' Dialog=lckus Help='Enter the ID of the user running the program';
Dialog study 'Study';
text #2 @3 'Enter the study';
text #4 @9 len=8;
Dialog dbl 'Database_Lock_date';
text #2 @3 'Enter the Database Lock date';
text #4 @9 len=9;
Dialog lckdt 'Lock_requestD&T';
text #2 @3 'Enter the Lock request date and time';
text #4 @9 len=22;
Dialog lckus 'Lockuser';
text #2 @3 'Enter the ID of the user running the program';
text #4 @9 len=10;
run;
quit;

 

Kindly advice.....

 

1 REPLY 1
DOBBINHO
Obsidian | Level 7

Hi all,

 

I was able to find a solution to the previous query, but another question arises in the midst of that. Is it possible to keep the windowing environment open in order to enter all the parameters that I need.

The modified code is as follows:

 

libname prith '/home/gurunatp/utilitytask';
proc pmenu catalog=prith.menus;
menu BASE;
item 'Enter parameters' menu=parameters;
item 'Bye';
menu parameters;
item 'Study' Dialog=study Help='Enter the Study';
item 'Database Lock date' Dialog=dbl Help='Enter the Database Lock date';
item 'Lock request date and time' Dialog=lckdt Help='Enter the Lock request date and time';
item 'Lock user' Dialog=lckus Help='Enter the ID of the user running the program';
Dialog study 'end;include prith.dat1.sas;c xx @1;submit';
text #1 @1 'Enter Study:';
text #3 @15 len=8;
Dialog dbl 'end;include prith.dat2.sas;c xx @1;submit';
text #1 @1 'Enter Database Lock date:';
text #3 @15 len=9;
Dialog lckdt 'end;include prith.dat3.sas;c xx @1;submit';
text #1 @1 'Enter the Lock request date and time:';
text #3 @15 len=23;
Dialog lckus 'end;include prith.dat4.sas;c xx @1;submit';
text #1 @1 'Enter the ID of the user running the program:';
text #3 @15 len=20;
run;
quit;

 

 

In the code above, dat1.sas, dat2.sas, dat3.sas, dat4.sas are all dataset statements to accept each entered parameter as a variable in their respective dataset.

 

Kindly advice.....

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 628 views
  • 0 likes
  • 1 in conversation