Rather odd problem I've just come across. I'm running the following code in SAS.
data manual_input;
infile datalines dlm=',';
length name $ 32 ;
input name $ varlist_no ;
datalines;
K0002,1
B0000,1
;
run;
When I run this normally in my enhanced editor in Enterprise Guide on our Unix server, it works fine, no problems.
When I run it through a %include statement, as follows:
filename ds_code "/wload/something/something/foo/bar";
%include ds_code ("varlist_input_test.sas") /source2;
The code no longer works. I get errors as follows:
NOTE: Invalid data for varlist_no in line 24 7-80.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
24 CHAR K0002,1.
ZONE 43333230222222222222222222222222222222222222222222222222222222222222222222222222
NUMR B0002C1D000000000000000000000000000000000000000000000000000000000000000000000000
name=K0002 varlist_no=. _ERROR_=1 _N_=1
NOTE: Invalid data for varlist_no in line 25 7-80.
25 CHAR B0000,1.
ZONE 43333230222222222222222222222222222222222222222222222222222222222222222222222222
NUMR 20000C1D000000000000000000000000000000000000000000000000000000000000000000000000
name=B0000 varlist_no=. _ERROR_=1 _N_=2
NOTE: The data set WORK.MANUAL_INPUT has 2 observations and 2 variables.
NOTE: Compressing data set WORK.MANUAL_INPUT increased size by 100.00 percent.
Compressed is 2 pages; un-compressed would require 1 pages.
What gives?! I've specified a comma delimited input. I also understand why datalines wouldn't work within a macro - why would you need to repetitively execute a static dataset input? However, I'd believe it perfectly acceptable to use an include statement to call a piece of code that uses cards/datalines.
Anyone have any ideas?