BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jorquec
Quartz | Level 8


Could somebody kindly help me ?

 

How do I correct?

 

What is wrong in my code, I received the message:

 

ERROR 22-322: Syntax error, expecting one of the following: a name, ;, (, *, -, /, :, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.

ERROR 76-322: Syntax error, statement will be ignored.

 

Code:

_______________________________________________

%let inset=dadosNOV18_mod_samp ; /* data set name */

%let target=FLAG_PORT_OUT; /* target variable (y) */

%let jorquec= d:/SAS/jorquec; /* designated folder for exporting outputs */

%let varall= pm_activity_level /* list of variables to be assessed*/

calling_circle_size

influencer_score

credit_band

data_allowance

mins_allowance

promo_data_allowance

texts_allowance

mins_utilsation

texts_utilsation

data_utilsation

rm.TENURE_MONTHS

rm.contract_flag

rm.contract_term_new

rm.pre_pri_accept_flag

;

 


%let tiermax=6; /* max number of bins to assign to variables */

%let ivthresh=0.1; /* set to 0 if you want to see output graphs for all variables */

%let outgraph=iv_woe_graph; /* pdf graph for top predictors */

%let ivout=iv_ranked; /* output file in txt for Information Value */

%let woeout=woe_ranked; /* output file in txt for Weight of Evidence */

%let libdata=jorquec; /* name of library where the data set is stored. */

%let outcome=pct_port_out; /* name of target for summary tables */

%let outname=% Customers Port_out; /* label of target for summary tables and graphs */

ods output nlevels=checkfreq;

proc freq data=&libdata..&inset nlevels;

tables &varall/noprint;

run;

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star
Assuming you fixed all the errors, your program would create a SAS data set named checkfreq. If you want to see what's in it, you have to add:

proc print data=checkfreq;
run;

In the long run, there is no substitute for learning the basics of SAS. You can't learn enough by asking a question when you are stumped. That's a good thing to do, but it's not enough.

View solution in original post

10 REPLIES 10
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

this line of code is missing a semicolon

where is the ;

%let varall= pm_activity_level /* list of variables to be assessed*/

it should be after the pm_activity_level like below

%let varall= pm_activity_level; /* list of variables to be assessed*/

Kurt_Bremser
Super User

These four

rm.TENURE_MONTHS
rm.contract_flag
rm.contract_term_new
rm.pre_pri_accept_flag

are not valid variable names for proc freq.

 

If that does not fix it, post your whole log of the %let statements and the failing step, using the {I} button.

jorquec
Quartz | Level 8

ok many thanks but why after  fix this this I can not see the output with the results ? Could you please tell me gow to print the information value table in the end?

jorquec
Quartz | Level 8

Hi

could someone kindly help me ?I am a SAS tarter,  I copied this code from web, but I dont know how tor print an output to see the information value results.

How do I correct?

Many thanks

____________________________________________________

CODE

 

%let inset=dadosNOV18_mod_samp ; /* data set name */

%let target=FLAG_PORT_OUT; /* target variable (y) */

%let jorquec= d:/SAS/jorquec; /* designated folder for exporting outputs */

%let varall= pm_activity_level /* list of variables to be assessed*/

 

calling_circle_size

influencer_score

credit_band

data_allowance

mins_allowance

promo_data_allowance

texts_allowance

mins_utilsation

texts_utilsation

data_utilsation

;

%let tiermax=6; /* max number of bins to assign to variables */

%let ivthresh=0.1; /* set to 0 if you want to see output graphs for all variables */

%let outgraph=iv_woe_graph; /* pdf graph for top predictors */

%let ivout=iv_ranked; /* output file in txt for Information Value */

%let woeout=woe_ranked; /* output file in txt for Weight of Evidence */

%let libdata=jorquec; /* name of library where the data set is stored. */

%let outcome=pct_port_out; /* name of target for summary tables */

%let outname=% Customers Port_out; /* label of target for summary tables and graphs */

 

Kurt_Bremser
Super User

There is nothing there that would provide output.

 

As a starter, I would STRONGLY recommend that you take the freely available online Programming 1 course instead of trying to run obscure code from the 'net. You will learn much better and quicker with the first.

jorquec
Quartz | Level 8

I would like to print  the table with the Information value reuslts.

 

 

 

proc hpbin data=&libdata..&inset WOE BINS_META=Mapping;

target FLAG_PORT_OUT/level=nominal order=desc;

 

 

run;

 

I guess this should be fine.

 

jorquec
Quartz | Level 8

Please could someone kindly help me ?I am a SAS tarter,  I copied this code from web, but I dont know how tor print an output to see the information value results.

It said a txt but I would like to see in sas windown output.

Also txt file it doesnt appear.

How do I correct?

Many thanks

____________________________________________________

CODE

 

%let inset=dadosNOV18_mod_samp ; /* data set name */

%let target=FLAG_PORT_OUT; /* target variable (y) */

%let jorquec= d:/SAS/jorquec; /* designated folder for exporting outputs */

%let varall= pm_activity_level /* list of variables to be assessed*/

 

calling_circle_size

influencer_score

credit_band

data_allowance

mins_allowance

promo_data_allowance

texts_allowance

mins_utilsation

texts_utilsation

data_utilsation

;

%let tiermax=6; /* max number of bins to assign to variables */

%let ivthresh=0.1; /* set to 0 if you want to see output graphs for all variables */

%let outgraph=iv_woe_graph; /* pdf graph for top predictors */

%let ivout=iv_ranked; /* output file in txt for Information Value */

%let woeout=woe_ranked; /* output file in txt for Weight of Evidence */

%let libdata=jorquec; /* name of library where the data set is stored. */

%let outcome=pct_port_out; /* name of target for summary tables */

%let outname=% Customers Port_out; /* label of target for summary tables and graphs */

Kurt_Bremser
Super User

Do not repeat posts with the same content. Keep the question in one thread, where it is much easier to follow the stream of questions and answers.

Astounding
PROC Star
Assuming you fixed all the errors, your program would create a SAS data set named checkfreq. If you want to see what's in it, you have to add:

proc print data=checkfreq;
run;

In the long run, there is no substitute for learning the basics of SAS. You can't learn enough by asking a question when you are stumped. That's a good thing to do, but it's not enough.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 10 replies
  • 1648 views
  • 2 likes
  • 4 in conversation