Thanks so much for your tips. Let me ask a couple more questions. From your advice, I come up with:
%MACRO IMPORTGSOD(mROWNUM=);
DATA _NULL_;
SET CLIMATE.STATIONSCOMBINED(OBS = mROWNUM);
CALL SYMPUT ("USAFtemp", USAF);
CALL SYMPUT ("WBANtemp", WBAN);
DATA WORK.STATION_1999_&USAFtemp.&WBANtemp.;
INFILE "C:\Users\Kevin\Documents\......\1999\&USAFtemp.-&WBANtemp.-1999.op"
FIRSTOBS = 2;
INPUT
...........
;
INFORMAT
........
;
RUN;
%MEND IMPORTGSOD;
%IMPORTGSOD(mROWNUM = 1);
However, with this, I get the following errors:
1 DATA _NULL_; SET CLIMATE.STATIONSCOMBINED(OBS = mROWNUM); CALL SYMPUT ("USAFtemp", USAF)
-------
23
1 ! ; CALL SYMPUT ("WBANtemp", WBAN); DATA WORK.STATION_1999_&USAFtemp.&WBANtemp.; INFILE
ERROR: Invalid number conversion on MROWNUM.
WARNING: Apparent symbolic reference USAFTEMP not resolved.
ERROR 23-7: Invalid value for the OBS option.
NOTE: Numeric values have been converted to character values at the places given by:
(Line):(Column).
1:87 1:119
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
NOTE: Line generated by the invoked macro "IMPORTGSOD".
1 DATA WORK.STATION_1999_&USAFtemp.&WBANtemp.; INFILE
-
22
---------
201
WARNING: Apparent symbolic reference WBANTEMP not resolved.
WARNING: Apparent symbolic reference USAFTEMP not resolved.
WARNING: Apparent symbolic reference WBANTEMP not resolved.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;,
_DATA_, _LAST_, _NULL_.
ERROR 201-322: The option is not recognized and will be ignored.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.STATION_1999_ may be incomplete. When this step was stopped there
were 0 observations and 30 variables.
WARNING: Data set WORK.STATION_1999_ was not replaced because this step was stopped.
------------------------------------------------------
It appears to me that there is an issue with:
1. passing the "1" for MNUMROW into the Macro, and
2. some problem with reading in the variables from USAF and WBAN into the macro.
I've tried putting the Data/Infile/Input/Informat stuff outside the macro, but this just changes up the error messages; however, it does work if I do this And change the Set parameter from (OBS = mROWNUM) to (OBS = 1); but I'm not sure why this isn't being passed into mROWNUM.
Any other suggestions?
I Greatly appreciate your help, this is pushing what I learned last semester in our SAS class, I don't know if we'll cover macros next semester, but I really need to figure out how to do something like this for a couple projects of mine.
THANKS!