Date: Mon, 16 Sep 1996 15:03:19 EDT
Reply-To: skd02@HEALTH.STATE.NY.US
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Stephen Dybas <skd02@HEALTH.STATE.NY.US>
Subject: Macro experts - I need your input!
SAS macro experts:
The following is a short program that I extracted from the SAS Macro Facility-
Tips & Techniques -- SAS Users Share Their Macro Expertise
I can't figure out why the input statement of the first call to the symput
function skips BOB and then picks up ANNE, the second call to function symput
picks up a missing value and the third call to the symput function picks up
RICHARD. Any insight into this problem would be appreciated.
1 options mprint symbolgen mlogic;
2 libname home '~';
NOTE: Libref HOME was successfully assigned as follows:
Engine: V611
Physical Name: /bur/bhe/user/skd02
3 filename datset '~/symput.txt';
4 data _null_;
5 infile datset obs=1;
6 input n1 $ n1 $ n3 $ ;
7 call symput('A',n1);
8 call symput('B',n2);
9 call symput('C',n3);
10
NOTE: Numeric values have been converted to character
values at the places given by: (Line):(Column).
8:17
NOTE: The infile DATSET is:
File Name=/bur/bhe/user/skd02/symput.txt,
Owner Name=skd02,Group Name=hcf,
Access Permission=rw-r--r--,
File Size (bytes)=57
NOTE: 1 record was read from the infile DATSET.
The minimum record length was 17.
The maximum record length was 17.
NOTE: DATA statement used:
real time 0.439 seconds
cpu time 0.235 seconds
11 data hours;
12 infile datset firstobs=2;
SYMBOLGEN: Macro variable A resolves to ANNE
13 input &A &B &C;
SYMBOLGEN: Macro variable B resolves to .
SYMBOLGEN: Macro variable C resolves to RICHARD
NOTE: Line generated by the macro variable "B".
13 .
-
200
ERROR 200-322: The symbol is not recognized.
14
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.HOURS may be incomplete. When this step was
stopped there were 0 observations and 2 variables.
NOTE: DATA statement used:
real time 0.163 seconds
cpu time 0.088 seconds
15 proc print data=hours;
SYMBOLGEN: Macro variable A resolves to ANNE
16 var &A &B &C;
SYMBOLGEN: Macro variable B resolves to .
SYMBOLGEN: Macro variable C resolves to RICHARD
NOTE: Line generated by the macro variable "B".
16 .
-
200
ERROR 200-322: The symbol is not recognized.
17 run;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used:
real time 0.114 seconds
cpu time 0.052 seconds
/*** Data from ascii file follows. ***/
BOB ANNE RICHARD
41 30 42
36 45 37
40 38 40
* Stephen Dybas skd02@health.state.ny.us
* DOH - BHE
* Room 1110, Corning Tower
* (518) 473-7883