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
Diamond | Level 26
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 5 replies
  • 1493 views
  • 0 likes
  • 4 in conversation