BookmarkSubscribeRSS Feed
ccnky123
Calcite | Level 5

Please kindly me help me with SAS syntax correct for each line.

Like line2 with the right option should be "out" but not "outdata"

1.
proc sort data=ccm_base_cust_inf_m(keep becif_custid cert_id_18)
2.
	outdata=ccm_base_cust_inf_m;
	where cert_id_18 <>"";
	by cert_id_18;

3.
proc sort data=prom_cust_inf(rename=(id=cert_id_18));
	by id;

4.
data prom_cust_inf_1;
5.
	merge prom_cust_inf(in=a)
		ccm_base_acct_inf_m(in=b);
6.
	by id;
	if a;
	length base_city=$20.;
	base_city=input(base_city,$city.);

7.
%let city=%str(NY","SH","TK");

8.
proc summary data=prom_cust_inf_1 nway;
9.
	by base_city;
10.
	var response_flag;
	out=stat_city_sum(drop=_type_) sum;
run;
5 REPLIES 5
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

change :

     outdata=ccm_base_cust_inf_m;

to:

    out=ccm_base_cust_inf_m;

Jagadishkatam
Amethyst | Level 16

1.
proc sort data=ccm_base_cust_inf_m(keep becif_custid cert_id_18)
2.
	out=ccm_base_cust_inf_m;
	where cert_id_18 ne "";
	by cert_id_18;

3.
proc sort data=prom_cust_inf out=(rename=(id=cert_id_18));
	by id;

4.
data prom_cust_inf_1;
5.
	merge prom_cust_inf(in=a)
		ccm_base_acct_inf_m(in=b);
6.
	by id;
	if a;
	length base_city $20.;
	base_city=input(base_city,$city.);

7.
%let city=%str(NY,SH,TK);

8.
proc summary data=prom_cust_inf_1 nway;
9.
	by base_city;
10.
	var response_flag;
	out=stat_city_sum(drop=_type_) sum;
run
Thanks,
Jag
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

That is it, does it work now?

Happy data mining Smiley Happy

ccnky123
Calcite | Level 5
there are many mistake in the answer,right?
Cynthia_sas
SAS Super FREQ
Hi:
You have the perfect opportunity here to use the SAS error messages in the log to teach you what is incorrect in the code.

You've supplied code, but you have not supplied data. If you took the numbers out of your code and just submitted the code, the SAS log would tell you where your errors were. Then, if you started from the top of the log and resolved each one, you would learn, for yourself, whether anything was wrong in the code.

Cynthia

Ready to join fellow brilliant minds for the SAS Hackathon?

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 is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 5 replies
  • 877 views
  • 0 likes
  • 4 in conversation