BookmarkSubscribeRSS Feed
zcmcderm
Calcite | Level 5

First time asking for help with SAS (not much experience using it). I pulled cumulative returns on the industries within the Consumer Discretionary Sector and not wish to make a long/short portfolio going long in the best performing industry while going short in the worst performing industry. The code I made is 

 

data SLPort;
	merge Textile3(in=a rename=_freq_=L_N) Automobile3(in=b rename=_freq_=S_N) class.ff_factors(in=c);
	by date;

	if a and b and c;
	S_L = gind252030_ewret - gind251020_ewret;
	format gind252030_ewret gind251020_ewret S_L percentn8.2;
run;

proc reg data=SLPort;
	model S_L=mktrf smb hml umd;
run;

 

 

however when I try to run the code, I receive and error saying that, The variable _NAME_ or _TYPE_ exists in a data set that is not TYPE=CORR, COV, SSCP, etc

 

Any help would be terrific! Also apologies if I posted this in the wrong location with the wrong subject

1 REPLY 1
Reeza
Super User

That's not an error that seems to align with the code you've posted. Can you please post your full log and code. Use the { i } to post your code to ensure it's formatted and not garbled in the web page.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1 reply
  • 648 views
  • 0 likes
  • 2 in conversation