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

I tried many ways and I cannot get this warning message away.  What did I do wrong?

PROC SQL;
CREATE TABLE QUERY_FOR_PROCESS_REQUEST AS 
SELECT t2.ID_PRODT, 
t1.Price, 
t1.coupon,
t1.PriceAsofDateTime
FROM process_request t1
INNER JOIN arm_mapping t2 ON (t1.BenchmarkSecurityProduct = t2.New_PMA_Service);
QUIT;

proc print data=QUERY_FOR_PROCESS_REQUEST;
run;

data prices(rename=(Price=RATE_PRCE_TBA Coupon=pct_cpn PriceAsofDateTime=DT_MKT)
keep=ID_PRODT PRCE_TBA pct_cpn DT_MKT);
set QUERY_FOR_PROCESS_REQUEST;
run;

proc print data=pms_arm_prices;
run;

WARNING: The variable Price in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable Coupon in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable PriceAsofDateTime in the DROP, KEEP, or RENAME list has never been referenced.
NOTE: There were 574 observations read from the data set QUERY_FOR_PROCESS_REQUEST.
NOTE: The data set PMS_ARM_PRICES has 574 observations and 1 variables.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

FYI: Anytime that have a Rename and Drop/Keep list in the same data set options the Drop/Keep list has to use the "old" name.

 

If had done the Rename on the SET statement the Keep would work as written. A matter of timing.

 

I was going to ask why you didn't just rename in the Proc SQL and completely avoid that data step.

 

And since you were using a data set created with only those variables to begin with I was questioning why a KEEP at all???

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

Please show us the log, intact, with nothing chopped out, so we can see where these WARNINGs appear.

 

When you copy the log, copy it as text, and paste it into the window that opens when you click on the </> icon. DO NOT SKIP THIS STEP.

--
Paige Miller
niejung
Obsidian | Level 7

Thank you.  I figured out the solution.  I rename the columns inside PROC SQL.  I don't need to do extra steps in dataset.

ballardw
Super User

FYI: Anytime that have a Rename and Drop/Keep list in the same data set options the Drop/Keep list has to use the "old" name.

 

If had done the Rename on the SET statement the Keep would work as written. A matter of timing.

 

I was going to ask why you didn't just rename in the Proc SQL and completely avoid that data step.

 

And since you were using a data set created with only those variables to begin with I was questioning why a KEEP at all???

Tom
Super User Tom
Super User

The dataset options are processed in alphabetical order.

DROP=
KEEP=
RENAME=
WHERE=

You are trying to rename PriceAsofDateTime to DT_MKT, but that variable is not in the list of variables you kept from the source dataset. 

 

ChrisNZ
Tourmaline | Level 20

D

K

R

W

happens to be alphabetical order, if that helps you remember the order.

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!
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
  • 5 replies
  • 7087 views
  • 1 like
  • 5 in conversation