BookmarkSubscribeRSS Feed
DOBBINHO
Obsidian | Level 7

Hi all,

 

I was working on a mini project to take in input from the user in order to use that input for an external utility program.

I have structured a menu for the window in such a way that all inputs are to be entered on the dialog boxes arising from different parameters selected in the menu.

But I have been undergoing a couple of issues in the same:

(a) This program doesn't seem to work the way it is supposed to outside the sas environment (I use the unix environment)

(b) The two date variables in the program are left unaltered, i.e; at the end of the program I only get xxxxxxxxx and xxxxxxxxxxxxxxxxxxxxxxx for the variables dblock and lckdtrf respectively.

 

My programs are as follows:

 

/*****pmenu2*****/

 

libname prith '/home/gurunatp/utilitytask';
proc pmenu catalog=prith.menus;
menu Conf;
item 'Confirm entered parameters' menu=start;
item 'Bye';
menu start;
item 'YES' selection=utility;
item 'NO' selection=back;
selection utility 'end;pgm;include /home/gurunatp/utilitytask/utility.sas;submit';
selection back 'end;pgm;include /home/gurunatp/utilitytask/pmenu3.sas;submit';
run;
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';
item 'Display Parameters' Selection=display;
Dialog study 'pgm;include /home/gurunatp/utilitytask/dat1.sas;c xxxxxxxx @1;submit';
text #1 @1 'Enter Study:';
text #3 @15 len=8;
Dialog dbl 'pgm;include /home/gurunatp/utilitytask/dat2.sas;c xxxxxxxxx @1;submit';
text #1 @1 'Enter Database Lock date:';
text #3 @15 len=9;
Dialog lckdt 'pgm;include /home/gurunatp/utilitytask/dat3.sas;c xxxxxxxxxxxxxxxxxxxxxxx @1;submit';
text #1 @1 'Enter the Lock request date and time:';
text #3 @15 len=23;
Dialog lckus 'pgm;include /home/gurunatp/utilitytask/dat4.sas;c xxxxxxxxxxxxxxxxxxxx @1;submit';
text #1 @1 'Enter the ID of the user running the program:';
text #3 @15 len=20;
Selection Display 'end;pgm;include /home/gurunatp/utilitytask/dat.sas;submit';
run;
quit;

/* define Window */
%window INPUTS Menu=prith.menus.BASE

#4 @10 'This application allows you to'
#6 @13 '-Enter necessary parameters for running'
#8 @13 ' the EDM to SDTM utility'
#10 @13 '-Exit from the SAS system'
#19 @10 'You must have the PMENU facility ON'
#20 @10 'Select Enter parameters or BYE';
/* display window */
%display INPUTS;

 

 

/*****dat1.sas*****/

 

data prith.dat1;
study='xxxxxxxx';
run;

 

/*****dat2.sas*****/

 

data prith.dat2;
dblock='xxxxxxxxx';
run;

/*****dat3.sas*****/

 

data prith.dat3;
lckdtrf='xxxxxxxxxxxxxxxxxxxxxxx';
run;

 

/*****dat4.sas*****/

 

data prith.dat4;
lckuser='xxxxxxxxxxxxxxxxxxxx';
run;

 

/*****dat.sas*****/

 

data prith.dat;
set prith.dat1;
set prith.dat2;
set prith.dat3;
set prith.dat4;
run;

%window OUTPUTS Menu=prith.menus.Conf

#4 @10 'Study:'
#6 @13 'Database lock date:'
#8 @13 'Lock request date and time:'
#10 @13 'Lock user:'
#19 @10 'You must have the PMENU facility ON'
#20 @10 'Select Confirm entered parameters or Bye';
/* display window */
%display OUTPUTS;

 

/*****pmenu3.sas*****/

 

/* define Window */
%window INPUTS Menu=prith.menus.BASE

#4 @10 'This application allows you to'
#6 @13 '-Enter necessary parameters for running'
#8 @13 ' the EDM to SDTM utility'
#10 @13 '-Exit from the SAS system'
#19 @10 'You must have the PMENU facility ON'
#20 @10 'Select Enter parameters or BYE';
/* display window */
%display INPUTS;

 

 

 

Kindly advice on how I can rectify the aforementioned issues?

 

Thanks and regards,

Dobbie

3 REPLIES 3
andreas_lds
Jade | Level 19

Please explain what


@DOBBINHO wrote:

(a) This program doesn't seem to work the way it is supposed to outside the sas environment (I use the unix environment)



means. "Does not work" can mean anything.

 

 

DOBBINHO
Obsidian | Level 7

The idea of this program is to take the required 4 inputs from the user and
check if the user is satisfied with his inputs. So what happens is when we
select each item, a corresponding dialog box pops up requiring entry of
user. Once the entry of one field is done, it should return to the window,
so that the user can proceed with entry of other values. Problem is,
outside the SAS environment, i.e; in the unix environment, once the user
enters the first value, the window closes down. Ideally, that is not supposed to happen, i.e; that way it isn't working the way it is supposed to....

DOBBINHO
Obsidian | Level 7

Hi all,

 

I have found out why exactly I wasn't able to run it outside the sas environment.

 

I found this out on a documentation of PROC PMENU that:

"Note: If you are using PROC PMENU to submit any command that is valid only in the PROGRAM EDITOR window (such as the INCLUDE command), you must have the windowing environment running, and you must return control to the PROGRAM EDITOR window."

 

Since that is the case, then I guess there must be a workaround for it. Point of the fact is that there is no proper documentation for what needs to be entered in the place of command string. I took many examples to understand the include was one of the commands that could be used in the command string, and that's exactly how I have built my program.

 

Could someone kindly suggestive any informative document for the same or even explain to me what are the other possible commands we could use in the PMENU procedure.

 

My program is as follows:

 

 

libname prith '/home/gurunatp/utilitytask';
proc pmenu catalog=prith.menus;
menu Conf;
item 'Confirm entered parameters' menu=start;
item 'Bye';
menu start;
item 'YES' selection=utility;
item 'NO' selection=back;
selection utility 'end;pgm;include /home/gurunatp/utilitytask/utility.sas;submit';
selection back 'end;pgm;include /home/pmenu3.sas;submit';
run;
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';
item 'Display Parameters' Selection=display;
Dialog study 'pgm;include /home/dat1.sas;c xxxxxxxx @1;submit';
text #1 @1 'Enter Study:';
text #3 @15 len=8;
Dialog dbl 'pgm;include /home/gurunatp/utilitytask/dat2.sas;c xxxxxxxxx @1;submit';
text #1 @1 'Enter Database Lock date:';
text #3 @15 len=9;
Dialog lckdt 'pgm;include /home/gurunatp/utilitytask/dat3.sas;c xxxxxxxxxxxxxxxxxxxxxxx @1;submit';
text #1 @1 'Enter the Lock request date and time:';
text #3 @15 len=23;
Dialog lckus 'pgm;include /home/gurunatp/utilitytask/dat4.sas;c xxxxxxxxxxxxxxxxxxxx @1;submit';
text #1 @1 'Enter the ID of the user running the program:';
text #3 @15 len=20;
Selection Display 'end;pgm;include /home/gurunatp/utilitytask/dat.sas;submit';
run;
quit;

/* define Window */
%window INPUTS Menu=prith.menus.BASE

#4 @10 'This application allows you to'
#6 @13 '-Enter necessary parameters for running'
#8 @13 ' the EDM to SDTM utility'
#10 @13 '-Exit from the SAS system'
#19 @10 'You must have the PMENU facility ON'
#20 @10 'Select Enter parameters or BYE';
/* display window */
%display INPUTS;

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 835 views
  • 0 likes
  • 2 in conversation