From: Mark Sussman on 16 Mar 2010 11:04 Hello all, I'm getting a "null parameters for symput are invalid" error with my code and was wondering if someone could help. This is just a subset of my larger code that I was telling your method on. Basically I'm using the variable sheet_name from the database SHEET_NAME which is a string like this 'Allberry, Loretta Ann - 5025' that will then be using to DDE a spreadsheet based on the results created in PLAINTIFF. Below is my code: %MACRO SCANLOOP(FIELD1); data _null_; if 0 then set sheet_name nobs=x; call symput('RECCOUNT',X); Stop; run; /* loop from one to number of */ /* records */ %DO I=1 %TO &RECCOUNT; data _null_; SET sheet_name (FIRSTOBS=&I); CALL SYMPUT('"VAR1"',&FIELD1); stop; run; data plaintiff(drop=sheet_name); set idde; if sheet_name="&VAR1"; run; %END; %MEND SCANLOOP; /* Call SCANLOOP */ %SCANLOOP %str(sheet_name); RUN;
From: Tom Abernathy on 16 Mar 2010 12:17 I see two places with strange syntax. 1) Your quoting in this statement CALL SYMPUT('"VAR1"',&FIELD1); Should be simplified to : call symput('var1',&field1); 2) You left off the () around the FIELD1 parameter value in your call to the SCANLOOP macro. Actually you ate them up by including the unneeded %STR macro funcation. Instead you should use: %scanloop(sheet_name); On Mar 16, 11:04 am, Mark Sussman <msuss...(a)gmail.com> wrote: > Hello all, > > I'm getting a "null parameters for symput are invalid" error with my > code and was wondering if someone could help. > > This is just a subset of my larger code that I was telling your method > on. Basically I'm using the variable sheet_name from the database > SHEET_NAME which is a string like this 'Allberry, Loretta Ann - 5025' > that will then be using to DDE a spreadsheet based on the results > created in PLAINTIFF. Below is my code: > > %MACRO SCANLOOP(FIELD1); > > data _null_; > if 0 then set sheet_name nobs=x; > call symput('RECCOUNT',X); > Stop; > run; > > /* loop from one to number of */ > /* records */ > %DO I=1 %TO &RECCOUNT; > data _null_; > SET sheet_name (FIRSTOBS=&I); > CALL SYMPUT('"VAR1"',&FIELD1); > stop; > run; > > data plaintiff(drop=sheet_name); > set idde; > if sheet_name="&VAR1"; > run; > > %END; > %MEND SCANLOOP; > /* Call SCANLOOP */ > %SCANLOOP %str(sheet_name); > RUN;
|
Pages: 1 Prev: statistical aspect Next: Install 32 bit SAS on a 64 bit machine? |