BookmarkSubscribeRSS Feed
Kishor_Gavade
Fluorite | Level 6

From SAS documentation i got this but i cant understand and unable to resolve value of sysbuff macro var 

i also attached what code i am doing below

-----------------SAS Documentation-------------------------------------------------------------------------------

This %INPUT statement accepts the values of the two macro variables WATRFALL and RIVER:
%input watrfall river;
If you enter the following text, there is not a one-to-one match between the two variable names and the text:
Angel Tributary of Caroni

For example, you can submit these statements:
%put WATRFALL contains: *&watrfall*;
%put RIVER contains: *&river*;
%put SYSBUFFR contains: *&sysbuffr*;
After execution, they produce this output in the SAS log:
WATRFALL contains: *Angel*
RIVER contains: *Tributary*
SYSBUFFR contains: * of Caroni*
As the SAS log demonstrates, the text stored in SYSBUFFR includes leading and embedded blanks.

 

-------------------------------------------------------------------------------------------------------------------

 

--------------------------My Code---------------------------------------------------------------------------

%input watrfall river;
Angel Tributary of Caroni;


%put WATRFALL contains: "&watrfall";
%put RIVER contains: "river";
%put SYSBUFFR contains: "&sysbuffr";

--------------------------------------------My log------------------------------------------------------

1 The SAS System 10:57 Wednesday, October 11, 2023

1 ;*';*";*/;quit;run;
2 OPTIONS PAGENO=MIN;
3 %LET _CLIENTTASKLABEL='Program';
4 %LET _CLIENTPROCESSFLOWNAME='Standalone Not In Project';
5 %LET _CLIENTPROJECTPATH='';
6 %LET _CLIENTPROJECTPATHHOST='';
7 %LET _CLIENTPROJECTNAME='';
8 %LET _SASPROGRAMFILE='';
9 %LET _SASPROGRAMFILEHOST='';
10
11 ODS _ALL_ CLOSE;
12 OPTIONS DEV=SVG;
13 GOPTIONS XPIXELS=0 YPIXELS=0;
14 %macro HTML5AccessibleGraphSupported;
15 %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) >= 0 %then ACCESSIBLE_GRAPH;
16 %mend;
17 FILENAME EGHTML TEMP;
18 ODS HTML5(ID=EGHTML) FILE=EGHTML
19 OPTIONS(BITMAP_MODE='INLINE')
20 %HTML5AccessibleGraphSupported
21 ENCODING='utf-8'
22 STYLE=HTMLBlue
23 NOGTITLE
24 NOGFOOTNOTE
25 GPATH=&sasworklocation
26 ;
NOTE: Writing HTML5(EGHTML) Body file: EGHTML
27
28 %input watrfall river;
29 Angel Tributary of Caroni;
_____
180

ERROR 180-322: Statement is not valid or it is used out of proper order.

30
31
32 %put WATRFALL contains: "&watrfall";
WATRFALL contains: ""
33 %put RIVER contains: "river";
RIVER contains: "river"
34 %put SYSBUFFR contains: "&sysbuffr";
SYSBUFFR contains: ""
35
36
37
38 %LET _CLIENTTASKLABEL=;
39 %LET _CLIENTPROCESSFLOWNAME=;
40 %LET _CLIENTPROJECTPATH=;
41 %LET _CLIENTPROJECTPATHHOST=;
42 %LET _CLIENTPROJECTNAME=;
43 %LET _SASPROGRAMFILE=;
44 %LET _SASPROGRAMFILEHOST=;
45
46 ;*';*";*/;quit;run;
47 ODS _ALL_ CLOSE;
48
49
2 The SAS System 10:57 Wednesday, October 11, 2023

50 QUIT; RUN;
51

4 REPLIES 4
yabwon
Onyx | Level 15

Doc. says:

"

The macro processor interprets the line submitted immediately after a %INPUT statement as the response to the %INPUT statement. That line can be part of an interactive line mode session, or it can be submitted from within the Code Editor window during a windowing environment session.

"

You are working in EG, right? It won't work there.

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



yabwon
Onyx | Level 15

For EG use "Prompts", RMB click on program -> Properties -> Prompts:

yabwon_1-1697013233130.png

 

Here is Video about it: https://video.sas.com/detail/video/6295499870001/create-and-use-prompts-in-queries-and-tasks

 

Bart

 

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



Kishor_Gavade
Fluorite | Level 6

I know this creating prompt but not getting concept of %input

ballardw
Super User

%input is supposed to read interactive values entered into an entry space created with %window and %display.

%window statements display text and optionally can have designated spaces to enter values. The values would be read by %input to place the value into a macro variable.

 

A %window that is displayed might look like this on a screen. If the code is done correctly your cursor should appear on the underline section and when you type something like John that value is stored in a macro variable.

+-------------------------------------------------------------+
|                                                             |
|   Enter your name: ______________                           |
|                                                             |
+-------------------------------------------------------------+

As such, the environment you work in may not allow the %display and %window statements to actually do anything because other tools are provided to have interactive data entry.

Some of this is very old school because the environment of some of the operating systems SAS ran on 40 years ago did not make it easy to access "window" creation outside of the OS programming layer. So SAS provided a one approach that would work on a line oriented display device.

 

 

Unless you are running Display Manager it is almost certain that %window, %display, %input (or the data step equivalents to place values into data set instead of macro variables) are not needed and extremely likely to just cause errors and confusion.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 4 replies
  • 672 views
  • 4 likes
  • 3 in conversation