BookmarkSubscribeRSS Feed
Afor910327
Obsidian | Level 7

Good afternoon,

 

I am getting a series of errors on this code, I think it is because of parenthesis, could you please point out clearly how could I fix this?

 

Thank you!

 

MPRINT(SERIES):   *********************************************************************************************;
MPRINT(SERIES):   ******************************************************************;
MPRINT(SERIES):   *********************************************************************************************;
MPRINT(SERIES):   proc sql;
SYMBOLGEN:  Macro variable DATASETPERIOD_ID resolves to        1576
NOTE: Line generated by the invoked macro "SERIES".
134    occ.datasetPeriod_id, occ.val from occ.indBR occ where datasetperiod_id = &datasetperiod_id) as occ join (select *
134 ! from cde.getCodes ('io','indfu','NAICS12')) as cde on occ.indCode_id = cde.code_id order by indCode ;  create table
                             -
                             79
134 ! tempsas.indInter as
ERROR 79-322: Expecting a ).

NOTE 137-205: Line generated by the invoked macro "SERIES".
134    occ.datasetPeriod_id, occ.val from occ.indBR occ where datasetperiod_id = &datasetperiod_id) as occ join (select *
134 ! from cde.getCodes ('io','indfu','NAICS12')) as cde on occ.indCode_id = cde.code_id order by indCode ;  create table
                                                -
                                                22
134 ! tempsas.indInter as
ERROR 22-322: Syntax error, expecting one of the following: a name, AS, ON.

NOTE: Line generated by the invoked macro "SERIES".
134    occ.datasetPeriod_id, occ.val from occ.indBR occ where datasetperiod_id = &datasetperiod_id) as occ join (select *
134 ! from cde.getCodes ('io','indfu','NAICS12')) as cde on occ.indCode_id = cde.code_id order by indCode ;  create table
                                                -
                                                200
134 ! tempsas.indInter as
ERROR 200-322: The symbol is not recognized and will be ignored.

SYMBOLGEN:  Macro variable IOYEAR resolves to 1998
SYMBOLGEN:  Macro variable DSNAME resolves to 'Annual17'
MPRINT(SERIES):   create table tempsas.totIndOut as select cde.code as indCode, occ.val as proval label = "Industry
Output" from (select occ.indCode_id, occ.datasetPeriod_id, occ.val from occ.indBR occ where datasetperiod_id = 1576) as
occ join (select * from cde.getCodes ('io','indfu','NAICS12' )) as cde on = order by indCode create table tempsas.indInter
as select indCode, sum(val) as Inter label="Intermediate Inputs" from trn.dataView where period = "1998" and
upcase(substr(itmCode,1,1)) not in ('T','V','W') and upcase(substr(indcode,1,1)) not in
('F','S','E','B','C','I','N','X','M') and upcase(valType) in ('DOM','IMP','CTX') and datasetName = 'Annual17' group by
indCode order by indcode ;
NOTE: Table TEMPSAS.INDINTER created, with 793 rows and 2 columns.

SYMBOLGEN:  Macro variable DSNAME resolves to 'Annual17'
SYMBOLGEN:  Macro variable IOYEAR resolves to 1998
MPRINT(SERIES):   create table tempsas.indComp as select indCode, sum(val) as compensation label="Compensation of
Employees" from trn.dataView where datasetName = 'Annual17' and upcase(substr(itmCode,1,1)) in ('W') and upcase(valType)
in ('DOM','IMP','CTX') and period = "1998" group by indCode order by indcode ;
NOTE: Table TEMPSAS.INDCOMP created, with 793 rows and 2 columns.

SYMBOLGEN:  Macro variable DSNAME resolves to 'Annual17'
SYMBOLGEN:  Macro variable IOYEAR resolves to 1998
MPRINT(SERIES):   create table tempsas.indIBT as select indCode, sum(val) as taxes label="Taxes on Production and Imports,
less Subsidies" from trn.dataView where datasetName = 'Annual17' and upcase(substr(itmCode,1,1)) in ('T') and
upcase(valType) in ('DOM','IMP','CTX') and period = "1998" group by indCode order by indcode ;
NOTE: Table TEMPSAS.INDIBT created, with 770 rows and 2 columns.

MPRINT(SERIES):   quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           5.03 seconds
      cpu time            0.18 seconds


MPRINT(SERIES):   data tempsas.ind_value_added;
MPRINT(SERIES):   merge tempsas.totIndOut tempsas.indInter tempsas.IndComp tempsas.indIBT;
ERROR: File TEMPSAS.TOTINDOUT.DATA does not exist.
MPRINT(SERIES):   by indCode;
MPRINT(SERIES):   array format{*} _numeric_;
MPRINT(SERIES):   do i=1 to dim(format);
MPRINT(SERIES):   if format{i} = . then format{i} = 0;
MPRINT(SERIES):   end;
MPRINT(SERIES):   GOS = sum(proVal,-1*inter,-1*compensation,-1*taxes);
MPRINT(SERIES):   label GOS = "Gross Operating Surplus";
MPRINT(SERIES):   drop i;
MPRINT(SERIES):   run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set TEMPSAS.IND_VALUE_ADDED may be incomplete.  When this step was stopped there were 0 observations and
         6 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(SERIES):   data tempsas.ind_VA_by_ACPSA;
MPRINT(SERIES):   merge tempsas.ind_value_added(in=a) tempsas.ind_conc_sort;
MPRINT(SERIES):   by indCode;
MPRINT(SERIES):   if a=1;

ERROR: BY variables are not properly sorted on data set TEMPSAS.IND_CONC_SORT.
a=0 indCode=9S9300 Inter= compensation= taxes= GOS= proVal= indCode_id=42514 indCodeDescr=Indian gambling indACPSA=ind99
indACPSADescr=All Other Industries FIRST.indCode=1 LAST.indCode=1 _ERROR_=1 _N_=850
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 0 observations read from the data set TEMPSAS.IND_VALUE_ADDED.
NOTE: There were 851 observations read from the data set TEMPSAS.IND_CONC_SORT.
WARNING: The data set TEMPSAS.IND_VA_BY_ACPSA may be incomplete.  When this step was stopped there were 0 observations and
         10 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds



MPRINT(SERIES):   proc sort data=tempsas.ind_VA_by_ACPSA out=tempsas.ind_VA_by_ACPSA_sort;
MPRINT(SERIES):   by indACPSA indACPSADescr;

NOTE: Input data set is empty.
NOTE: The data set TEMPSAS.IND_VA_BY_ACPSA_SORT has 0 observations and 10 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


SYMBOLGEN:  Macro variable IOYEAR resolves to 1998
MPRINT(SERIES):   data tempsas.ind_VA_by_ACPSA_2 int_sas.ind_VA_by_ACPSA_1998;
MPRINT(SERIES):   set tempsas.ind_VA_by_ACPSA_sort;
MPRINT(SERIES):   indACPSADescr = propcase(indACPSADescr);
MPRINT(SERIES):   Value_added = compensation + taxes + GOS;
MPRINT(SERIES):   label Value_Added = "Value Added";

NOTE: There were 0 observations read from the data set TEMPSAS.IND_VA_BY_ACPSA_SORT.
NOTE: The data set TEMPSAS.IND_VA_BY_ACPSA_2 has 0 observations and 11 variables.
NOTE: The data set INT_SAS.IND_VA_BY_ACPSA_1998 has 0 observations and 11 variables.
NOTE: DATA statement used (Total process time):
      real time           0.15 seconds
      cpu time            0.04 seconds


MPRINT(SERIES):   proc summary data=tempsas.ind_VA_by_ACPSA_2;
MPRINT(SERIES):   by indACPSA;
MPRINT(SERIES):   id indACPSADescr;
MPRINT(SERIES):   var proVal inter Value_Added compensation taxes GOS;
MPRINT(SERIES):   format proVal inter Value_Added compensation taxes GOS comma13.1;
MPRINT(SERIES):   output out=tempsas.ind_VA_summary (drop=_type_ _freq_) sum=;
NOTE: No observations in data set TEMPSAS.IND_VA_BY_ACPSA_2.
NOTE: The data set TEMPSAS.IND_VA_SUMMARY has 0 observations and 8 variables.
NOTE: PROCEDURE SUMMARY used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


MPRINT(SERIES):   proc transpose data=tempsas.ind_VA_summary out=tempsas.ind_VA_summary_t(drop=_name_)
label=itemACPSADescr;
MPRINT(SERIES):   id indACPSA;
MPRINT(SERIES):   idlabel indACPSADescr;

NOTE: There were 0 observations read from the data set TEMPSAS.IND_VA_SUMMARY.
NOTE: The data set TEMPSAS.IND_VA_SUMMARY_T has 6 observations and 1 variables.
NOTE: PROCEDURE TRANSPOSE used (Total process time):
      real time           0.02 seconds
      cpu time            0.00 seconds


NOTE: Line generated by the invoked macro "SERIES".
147     data tempsas.Value_Added_Format; set tempsas.ind_VA_summary_t;  Total_Output = sum(of ind:);  format Total_Output
                                                                                       ---
                                                                                       71
147 ! comma13.1;  label Total_Output = "Domestic Production at Producers' Prices";  run;  proc sql;  create table
147 ! tempsas.make_body_union_order
MPRINT(SERIES):   data tempsas.Value_Added_Format;
MPRINT(SERIES):   set tempsas.ind_VA_summary_t;
MPRINT(SERIES):   Total_Output = sum(of ind:);
MPRINT(SERIES):   format Total_Output comma13.1;
MPRINT(SERIES):   label Total_Output = "Domestic Production at Producers' Prices";
MPRINT(SERIES):   run;

ERROR 71-185: The SUM function call does not have enough arguments.

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set TEMPSAS.VALUE_ADDED_FORMAT may be incomplete.  When this step was stopped there were 0 observations
         and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


MPRINT(SERIES):   proc sql;
SYMBOLGEN:  Macro variable ACPSAITEMORDERCC resolves to itemacpsa_sum_order_naics2012
MPRINT(SERIES):   create table tempsas.make_body_union_order as select both.* from ( select * from
tempsas.make_body_format union select * from tempsas.make_body_summary_1 where itemACPSA ne 'tArts' ) as both join
concord.itemacpsa_sum_order_naics2012 cc on both.itemACPSA = cc.itemACPSA order by cc.pubOrder ;
NOTE: The query as specified involves ordering by an item that doesn't appear in its SELECT clause.
NOTE: Table TEMPSAS.MAKE_BODY_UNION_ORDER created, with 74 rows and 39 columns.

MPRINT(SERIES):   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.07 seconds
      cpu time            0.07 seconds


SYMBOLGEN:  Macro variable IOYEAR resolves to 1998
SYMBOLGEN:  Macro variable IOYEAR resolves to 1998
MPRINT(SERIES):   data int_sas.Table1_Production_1998 tempsas.Table1_Production_1998;
MPRINT(SERIES):   set tempsas.make_body_union_order tempsas.Value_Added_Format;
MPRINT(SERIES):   label itemACPSADescr = "Commodities";
MPRINT(SERIES):   run;

NOTE: There were 74 observations read from the data set TEMPSAS.MAKE_BODY_UNION_ORDER.
NOTE: There were 0 observations read from the data set TEMPSAS.VALUE_ADDED_FORMAT.
NOTE: The data set INT_SAS.TABLE1_PRODUCTION_1998 has 74 observations and 39 variables.
NOTE: The data set TEMPSAS.TABLE1_PRODUCTION_1998 has 74 observations and 39 variables.
NOTE: DATA statement used (Total process time):
      real time           0.12 seconds
      cpu time            0.01 seconds

 

6 REPLIES 6
Afor910327
Obsidian | Level 7

Good afternoon,

 

I am getting a series of errors on this code, I think it is because of parenthesis, could you please point out clearly how could I fix this?

 

Thank you!

 


MPRINT(SERIES): *********************************************************************************************;
MPRINT(SERIES): *******************************************************************;
MPRINT(SERIES): *********************************************************************************************;
MPRINT(SERIES): proc sql;
SYMBOLGEN: Macro variable DATASETPERIOD_ID resolves to 1576
NOTE: Line generated by the invoked macro "SERIES".
134 occ.datasetPeriod_id, occ.val from occ.indBR occ where datasetperiod_id = &datasetperiod_id) as occ join (select *
134 ! from cde.getCodes ('io','indfu','NAICS12')) as cde on occ.indCode_id = cde.code_id order by indCode ; create table
-
79
134 ! tempsas.indInter as
ERROR 79-322: Expecting a ).

NOTE 137-205: Line generated by the invoked macro "SERIES".
134 occ.datasetPeriod_id, occ.val from occ.indBR occ where datasetperiod_id = &datasetperiod_id) as occ join (select *
134 ! from cde.getCodes ('io','indfu','NAICS12')) as cde on occ.indCode_id = cde.code_id order by indCode ; create table
-
22
134 ! tempsas.indInter as
ERROR 22-322: Syntax error, expecting one of the following: a name, AS, ON.

NOTE: Line generated by the invoked macro "SERIES".
134 occ.datasetPeriod_id, occ.val from occ.indBR occ where datasetperiod_id = &datasetperiod_id) as occ join (select *
134 ! from cde.getCodes ('io','indfu','NAICS12')) as cde on occ.indCode_id = cde.code_id order by indCode ; create table
-
200
134 ! tempsas.indInter as
ERROR 200-322: The symbol is not recognized and will be ignored.

SYMBOLGEN: Macro variable IOYEAR resolves to 1998
SYMBOLGEN: Macro variable DSNAME resolves to 'Annual17'
MPRINT(SERIES): create table tempsas.totIndOut as select cde.code as indCode, occ.val as proval label = "Industry
Output" from (select occ.indCode_id, occ.datasetPeriod_id, occ.val from occ.indBR occ where datasetperiod_id = 1576) as
occ join (select * from cde.getCodes ('io','indfu','NAICS12' )) as cde on = order by indCode create table tempsas.indInter
as select indCode, sum(val) as Inter label="Intermediate Inputs" from trn.dataView where period = "1998" and
upcase(substr(itmCode,1,1)) not in ('T','V','W') and upcase(substr(indcode,1,1)) not in
('F','S','E','B','C','I','N','X','M') and upcase(valType) in ('DOM','IMP','CTX') and datasetName = 'Annual17' group by
indCode order by indcode ;
NOTE: Table TEMPSAS.INDINTER created, with 793 rows and 2 columns.

SYMBOLGEN: Macro variable DSNAME resolves to 'Annual17'
SYMBOLGEN: Macro variable IOYEAR resolves to 1998
MPRINT(SERIES): create table tempsas.indComp as select indCode, sum(val) as compensation label="Compensation of
Employees" from trn.dataView where datasetName = 'Annual17' and upcase(substr(itmCode,1,1)) in ('W') and upcase(valType)
in ('DOM','IMP','CTX') and period = "1998" group by indCode order by indcode ;
NOTE: Table TEMPSAS.INDCOMP created, with 793 rows and 2 columns.

SYMBOLGEN: Macro variable DSNAME resolves to 'Annual17'
SYMBOLGEN: Macro variable IOYEAR resolves to 1998
MPRINT(SERIES): create table tempsas.indIBT as select indCode, sum(val) as taxes label="Taxes on Production and Imports,
less Subsidies" from trn.dataView where datasetName = 'Annual17' and upcase(substr(itmCode,1,1)) in ('T') and
upcase(valType) in ('DOM','IMP','CTX') and period = "1998" group by indCode order by indcode ;
NOTE: Table TEMPSAS.INDIBT created, with 770 rows and 2 columns.

MPRINT(SERIES): quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 5.03 seconds
cpu time 0.18 seconds


MPRINT(SERIES): data tempsas.ind_value_added;
MPRINT(SERIES): merge tempsas.totIndOut tempsas.indInter tempsas.IndComp tempsas.indIBT;
ERROR: File TEMPSAS.TOTINDOUT.DATA does not exist.
MPRINT(SERIES): by indCode;
MPRINT(SERIES): array format{*} _numeric_;
MPRINT(SERIES): do i=1 to dim(format);
MPRINT(SERIES): if format{i} = . then format{i} = 0;
MPRINT(SERIES): end;
MPRINT(SERIES): GOS = sum(proVal,-1*inter,-1*compensation,-1*taxes);
MPRINT(SERIES): label GOS = "Gross Operating Surplus";
MPRINT(SERIES): drop i;
MPRINT(SERIES): run;

PaigeMiller
Diamond | Level 26

We need to have the LOG properly formatted to make it readable. To do this, please click on the {i} icon and paste the log into the window that appears.

 

Also, please go back to your original post and provide a meaningful title that describes the issue.

--
Paige Miller
Afor910327
Obsidian | Level 7
Hi Paige,

I just did what you told me to.


Thank you so much!
MPRINT(SERIES): *********************************************************************************************; MPRINT(SERIES): ******************************************************************; MPRINT(SERIES): *********************************************************************************************; MPRINT(SERIES): proc sql; SYMBOLGEN: Macro variable DATASETPERIOD_ID resolves to 1576 NOTE: Line generated by the invoked macro "SERIES". 134 occ.datasetPeriod_id, occ.val from occ.indBR occ where datasetperiod_id = &datasetperiod_id) as occ join (select * 134 ! from cde.getCodes ('io','indfu','NAICS12')) as cde on occ.indCode_id = cde.code_id order by indCode ; create table - 79 134 ! tempsas.indInter as ERROR 79-322: Expecting a ). NOTE 137-205: Line generated by the invoked macro "SERIES". 134 occ.datasetPeriod_id, occ.val from occ.indBR occ where datasetperiod_id = &datasetperiod_id) as occ join (select * 134 ! from cde.getCodes ('io','indfu','NAICS12')) as cde on occ.indCode_id = cde.code_id order by indCode ; create table - 22 134 ! tempsas.indInter as ERROR 22-322: Syntax error, expecting one of the following: a name, AS, ON. NOTE: Line generated by the invoked macro "SERIES". 134 occ.datasetPeriod_id, occ.val from occ.indBR occ where datasetperiod_id = &datasetperiod_id) as occ join (select * 134 ! from cde.getCodes ('io','indfu','NAICS12')) as cde on occ.indCode_id = cde.code_id order by indCode ; create table - 200 134 ! tempsas.indInter as ERROR 200-322: The symbol is not recognized and will be ignored. SYMBOLGEN: Macro variable IOYEAR resolves to 1998 SYMBOLGEN: Macro variable DSNAME resolves to 'Annual17' MPRINT(SERIES): create table tempsas.totIndOut as select cde.code as indCode, occ.val as proval label = "Industry Output" from (select occ.indCode_id, occ.datasetPeriod_id, occ.val from occ.indBR occ where datasetperiod_id = 1576) as occ join (select * from cde.getCodes ('io','indfu','NAICS12' )) as cde on = order by indCode create table tempsas.indInter as select indCode, sum(val) as Inter label="Intermediate Inputs" from trn.dataView where period = "1998" and upcase(substr(itmCode,1,1)) not in ('T','V','W') and upcase(substr(indcode,1,1)) not in ('F','S','E','B','C','I','N','X','M') and upcase(valType) in ('DOM','IMP','CTX') and datasetName = 'Annual17' group by indCode order by indcode ; NOTE: Table TEMPSAS.INDINTER created, with 793 rows and 2 columns. SYMBOLGEN: Macro variable DSNAME resolves to 'Annual17' SYMBOLGEN: Macro variable IOYEAR resolves to 1998 MPRINT(SERIES): create table tempsas.indComp as select indCode, sum(val) as compensation label="Compensation of Employees" from trn.dataView where datasetName = 'Annual17' and upcase(substr(itmCode,1,1)) in ('W') and upcase(valType) in ('DOM','IMP','CTX') and period = "1998" group by indCode order by indcode ; NOTE: Table TEMPSAS.INDCOMP created, with 793 rows and 2 columns. SYMBOLGEN: Macro variable DSNAME resolves to 'Annual17' SYMBOLGEN: Macro variable IOYEAR resolves to 1998 MPRINT(SERIES): create table tempsas.indIBT as select indCode, sum(val) as taxes label="Taxes on Production and Imports, less Subsidies" from trn.dataView where datasetName = 'Annual17' and upcase(substr(itmCode,1,1)) in ('T') and upcase(valType) in ('DOM','IMP','CTX') and period = "1998" group by indCode order by indcode ; NOTE: Table TEMPSAS.INDIBT created, with 770 rows and 2 columns. MPRINT(SERIES): quit; NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE SQL used (Total process time): real time 5.03 seconds cpu time 0.18 seconds MPRINT(SERIES): data tempsas.ind_value_added; MPRINT(SERIES): merge tempsas.totIndOut tempsas.indInter tempsas.IndComp tempsas.indIBT; ERROR: File TEMPSAS.TOTINDOUT.DATA does not exist. MPRINT(SERIES): by indCode; MPRINT(SERIES): array format{*} _numeric_; MPRINT(SERIES): do i=1 to dim(format); MPRINT(SERIES): if format{i} = . then format{i} = 0; MPRINT(SERIES): end; MPRINT(SERIES): GOS = sum(proVal,-1*inter,-1*compensation,-1*taxes); MPRINT(SERIES): label GOS = "Gross Operating Surplus"; MPRINT(SERIES): drop i; MPRINT(SERIES): run; NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set TEMPSAS.IND_VALUE_ADDED may be incomplete. When this step was stopped there were 0 observations and 6 variables. NOTE: DATA statement used (Total process time): real time 0.02 seconds cpu time 0.01 seconds MPRINT(SERIES): data tempsas.ind_VA_by_ACPSA; MPRINT(SERIES): merge tempsas.ind_value_added(in=a) tempsas.ind_conc_sort; MPRINT(SERIES): by indCode; MPRINT(SERIES): if a=1; ERROR: BY variables are not properly sorted on data set TEMPSAS.IND_CONC_SORT. a=0 indCode=9S9300 Inter= compensation= taxes= GOS= proVal= indCode_id=42514 indCodeDescr=Indian gambling indACPSA=ind99 indACPSADescr=All Other Industries FIRST.indCode=1 LAST.indCode=1 _ERROR_=1 _N_=850 NOTE: The SAS System stopped processing this step because of errors. NOTE: There were 0 observations read from the data set TEMPSAS.IND_VALUE_ADDED. NOTE: There were 851 observations read from the data set TEMPSAS.IND_CONC_SORT. WARNING: The data set TEMPSAS.IND_VA_BY_ACPSA may be incomplete. When this step was stopped there were 0 observations and 10 variables. NOTE: DATA statement used (Total process time): real time 0.02 seconds cpu time 0.01 seconds MPRINT(SERIES): proc sort data=tempsas.ind_VA_by_ACPSA out=tempsas.ind_VA_by_ACPSA_sort; MPRINT(SERIES): by indACPSA indACPSADescr; NOTE: Input data set is empty. NOTE: The data set TEMPSAS.IND_VA_BY_ACPSA_SORT has 0 observations and 10 variables. NOTE: PROCEDURE SORT used (Total process time): real time 0.01 seconds cpu time 0.01 seconds SYMBOLGEN: Macro variable IOYEAR resolves to 1998 MPRINT(SERIES): data tempsas.ind_VA_by_ACPSA_2 int_sas.ind_VA_by_ACPSA_1998; MPRINT(SERIES): set tempsas.ind_VA_by_ACPSA_sort; MPRINT(SERIES): indACPSADescr = propcase(indACPSADescr); MPRINT(SERIES): Value_added = compensation + taxes + GOS; MPRINT(SERIES): label Value_Added = "Value Added"; NOTE: There were 0 observations read from the data set TEMPSAS.IND_VA_BY_ACPSA_SORT. NOTE: The data set TEMPSAS.IND_VA_BY_ACPSA_2 has 0 observations and 11 variables. NOTE: The data set INT_SAS.IND_VA_BY_ACPSA_1998 has 0 observations and 11 variables. NOTE: DATA statement used (Total process time): real time 0.15 seconds cpu time 0.04 seconds MPRINT(SERIES): proc summary data=tempsas.ind_VA_by_ACPSA_2; MPRINT(SERIES): by indACPSA; MPRINT(SERIES): id indACPSADescr; MPRINT(SERIES): var proVal inter Value_Added compensation taxes GOS; MPRINT(SERIES): format proVal inter Value_Added compensation taxes GOS comma13.1; MPRINT(SERIES): output out=tempsas.ind_VA_summary (drop=_type_ _freq_) sum=; NOTE: No observations in data set TEMPSAS.IND_VA_BY_ACPSA_2. NOTE: The data set TEMPSAS.IND_VA_SUMMARY has 0 observations and 8 variables. NOTE: PROCEDURE SUMMARY used (Total process time): real time 0.03 seconds cpu time 0.01 seconds MPRINT(SERIES): proc transpose data=tempsas.ind_VA_summary out=tempsas.ind_VA_summary_t(drop=_name_) label=itemACPSADescr; MPRINT(SERIES): id indACPSA; MPRINT(SERIES): idlabel indACPSADescr; NOTE: There were 0 observations read from the data set TEMPSAS.IND_VA_SUMMARY. NOTE: The data set TEMPSAS.IND_VA_SUMMARY_T has 6 observations and 1 variables. NOTE: PROCEDURE TRANSPOSE used (Total process time): real time 0.02 seconds cpu time 0.00 seconds NOTE: Line generated by the invoked macro "SERIES". 147 data tempsas.Value_Added_Format; set tempsas.ind_VA_summary_t; Total_Output = sum(of ind:); format Total_Output --- 71 147 ! comma13.1; label Total_Output = "Domestic Production at Producers' Prices"; run; proc sql; create table 147 ! tempsas.make_body_union_order MPRINT(SERIES): data tempsas.Value_Added_Format; MPRINT(SERIES): set tempsas.ind_VA_summary_t; MPRINT(SERIES): Total_Output = sum(of ind:); MPRINT(SERIES): format Total_Output comma13.1; MPRINT(SERIES): label Total_Output = "Domestic Production at Producers' Prices"; MPRINT(SERIES): run; ERROR 71-185: The SUM function call does not have enough arguments. NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set TEMPSAS.VALUE_ADDED_FORMAT may be incomplete. When this step was stopped there were 0 observations and 2 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds MPRINT(SERIES): proc sql; SYMBOLGEN: Macro variable ACPSAITEMORDERCC resolves to itemacpsa_sum_order_naics2012 MPRINT(SERIES): create table tempsas.make_body_union_order as select both.* from ( select * from tempsas.make_body_format union select * from tempsas.make_body_summary_1 where itemACPSA ne 'tArts' ) as both join concord.itemacpsa_sum_order_naics2012 cc on both.itemACPSA = cc.itemACPSA order by cc.pubOrder ; NOTE: The query as specified involves ordering by an item that doesn't appear in its SELECT clause. NOTE: Table TEMPSAS.MAKE_BODY_UNION_ORDER created, with 74 rows and 39 columns. MPRINT(SERIES): quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.07 seconds cpu time 0.07 seconds SYMBOLGEN: Macro variable IOYEAR resolves to 1998 SYMBOLGEN: Macro variable IOYEAR resolves to 1998 MPRINT(SERIES): data int_sas.Table1_Production_1998 tempsas.Table1_Production_1998; MPRINT(SERIES): set tempsas.make_body_union_order tempsas.Value_Added_Format; MPRINT(SERIES): label itemACPSADescr = "Commodities"; MPRINT(SERIES): run; NOTE: There were 74 observations read from the data set TEMPSAS.MAKE_BODY_UNION_ORDER. NOTE: There were 0 observations read from the data set TEMPSAS.VALUE_ADDED_FORMAT. NOTE: The data set INT_SAS.TABLE1_PRODUCTION_1998 has 74 observations and 39 variables. NOTE: The data set TEMPSAS.TABLE1_PRODUCTION_1998 has 74 observations and 39 variables. NOTE: DATA statement used (Total process time): real time 0.12 seconds cpu time 0.01 seconds
r_behata
Barite | Level 11

Tried partially Re-constructing the PROC SQL from the Log that you shared.

 

 proc sql;
   occ.datasetPeriod_id, occ.val from occ.indBR occ where datasetperiod_id = &datasetperiod_id) as occ join (select *
 from cde.getCodes ('io','indfu','NAICS12')) as cde on occ.indCode_id = cde.code_id order by indCode ;  create table

The syntax does not make sense , unless there is some copy paste error.

 

Could you give some context into this query which will help analyze this better :

Ex : Did you copied this code from some other program,perhaps part of it was not copied properly ?  or was this is this a pass through query having a different syntax which you are trying to run in sas ?

 

 

 

 

 

 

 

Kurt_Bremser
Super User

I see no "select" keyword in your SQL code, which is mandatory given what follows.

 

Rule #1 of macro development: start with WORKING SAS code before applying ANY macro logic.

So you need to remove all macro statements, replace the macro variable references with test values, and then work on that code until it runs free of WARNINGs and ERRORs. Then you can start to make it dynamic.

Tom
Super User Tom
Super User

Before writing a macro make sure you know what code you want it to generate.

What did you think this syntax meant?

join (select * from cde.getCodes ('io','indfu','NAICS12')) as cde

It looks a little like you are referring to the dataset named GETCODES in a library named CDE.  But the stuff inside the ( ) is not valid dataset options.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1402 views
  • 1 like
  • 5 in conversation