I am trying to run this part of code ...
proc sql;
create table &lib1..PR_&str. as
select a.*, count(*) as NumYears
from &lib1..PR_&str. a
group by %group_by_RiskCollectiveTY(lvl=&RCTY.);
quit;
%chk_err;
data &lib1..ILLC_&SEL_IL.&str. (drop = HILLY
COASTAL
SEASON_DESC
CROP_GROUP_DESC
CROP_DESC
NOTIFIED_AREA
DAIU
PY_Cred_Z
AveLC_Unc
ProductBaseRate
Var_LCRC
NumYears
LEVEL1_NAME
LEVEL2_NAME
IL_Weight
LossCostCap
IL_LossCostCap
IndemnityLevel);
set &lib1..PR_&str.;
run;
then I am getting error like :
MPRINT(RUN_PRICE_MODEL): proc sql;
2695 +
Level3_Code,hilly,crop_group_code,crop_code,season_code,NOTIFIED_AREA,NOTIFIED_AREA_CODE;
MPRINT(RUN_PRICE_MODEL): create table work.PR_GJKHAMuth as select a.*, count(*) as NumYears
from work.PR_GJKHAMuth a group by Level1_Code, Level2_Code,
Level3_Code,hilly,crop_group_code,crop_code,season_code,NOTIFIED_AREA,NOTIFIED_AREA_CODE;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of
this is a possible data integrity problem.
NOTE: Table WORK.PR_GJKHAMUTH created, with 90 rows and 37 columns.
2695 +
quit;
MPRINT(RUN_PRICE_MODEL): quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
Memory 123427k
OS Memory 137952k
Timestamp 25-08-2015 16:56:08
2695 +
; data work.ILLC_90_AppliedGJKHAMuth (drop = HILLY COASTAL
SEASON_DESC CROP_GROUP_DESC CROP_DESC
MPRINT(RUN_PRICE_MODEL): ;
2696 + NOTIFIED_AREA DAIU PY_Cred_Z AveLC_Unc
ProductBaseRate Var_LCRC NumYears LEVEL1_NAME
LEVEL2_NAME IL_Weight LossCostCap IL_LossCostCap
2697 + IndemnityLevel); set work.PR_
MPRINT(RUN_PRICE_MODEL): data work.ILLC_90_AppliedGJKHAMuth (drop = HILLY COASTAL
SEASON_DESC CROP_GROUP_DESC CROP_DESC NOTIFIED_AREA DAIU PY_Cred_Z AveLC_Unc ProductBaseRate
Var_LCRC NumYears LEVEL1_NAME LEVEL2_NAME IL_Weight LossCostCap IL_LossCostCap IndemnityLevel);
2698 +GJKHAMuth; run;
3179 The SAS System 15:24 Tuesday, August 25, 2015
MPRINT(RUN_PRICE_MODEL): set work.PR_ GJKHAMuth;
ERROR: File WORK.PR_.DATA does not exist.
ERROR: File WORK.GJKHAMUTH.DATA does not exist.
MPRINT(RUN_PRICE_MODEL): run;
WARNING: The variable HILLY in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable COASTAL in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable SEASON_DESC in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable CROP_GROUP_DESC in the DROP, KEEP, or RENAME list has never been
referenced.
WARNING: The variable CROP_DESC in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable NOTIFIED_AREA in the DROP, KEEP, or RENAME list has never been
referenced.
WARNING: The variable DAIU in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable PY_Cred_Z in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable AveLC_Unc in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable ProductBaseRate in the DROP, KEEP, or RENAME list has never been
referenced.
WARNING: The variable Var_LCRC in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable NumYears in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable LEVEL1_NAME in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable LEVEL2_NAME in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable IL_Weight in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable LossCostCap in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable IL_LossCostCap in the DROP, KEEP, or RENAME list has never been
referenced.
WARNING: The variable IndemnityLevel in the DROP, KEEP, or RENAME list has never been
referenced.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.ILLC_90_APPLIEDGJKHAMUTH may be incomplete. When this step was
stopped there were 0 observations and 0 variables.
And also I ma getting this typer of Error Abruptly. Not always at Same type Error.
Its taking space in the data set name.
So please help on this .
Somehow, in your macro code a space has been added:
set work.PR_ GJKHAMuth;
^
You need to look at the code which is creating &STR., and strip(), trim(), or use symputx(). Or put around it %trim(&STR.). That should get rid of the space. Haven't looked at the rest of it.
Make sure that your macro variable that you are using to construct the dataset name does not contain leading spaces.
Otherwise you might just be getting impacted by an interaction between macro quoted strings and the SAS tokenizer.
Try adding %UNQUOTE() function call so that SAS knows to treat the dataset name as one string instead of two.
set %unquote(work.pr_&str) ;
Thanks Tom,
Actually with same macro variable we are able to access the same data set and when we are seting this data set in another data set then we are getting this type of error.
Is it also possible that there may be some issue of SPACE as its working very wrong way ?. When we run the same code with less input then we are not getting this type of error.
Also SAS Eg getting hanged continuously.
Message was edited by: NANDAN KUMAR
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!What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: