SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

WARNING: The variable in the DROP, KEEP, or RENAME list has never been referenced

Reply
Frequent Contributor
Posts: 124

WARNING: The variable in the DROP, KEEP, or RENAME list has never been referenced

Hi, I had created a new variable (newid) in dataset 'A' by using concatenating 2 or more fields( which I later deleted from the dataset)

This is how dataset A looks:

oldidsortidnewidOthervariable1Othervariable2Othervariable3
341A0101E
562A0102E
783A0102E

I need to use the newid in dataset A to merge it with dataset B . It will be merged by variable oldid. This is how dataset B looks:

Oldidothervariables...
34 xxx
34 xxx
56 xxx
56 xxxx
78 xxxx
78 xxx
37 xx
37 xx
48 xx
48 xx

I need to have a final dataset that looks like this ;

Oldidsortidnewid
341A0101E
341A0101E
562A0102E
562A0102E
783A0102E
783A0102E
37.
37.
48.
48..

For the merge ,I need only  the oldid , sortind and newid from dataset A, so I created  a dataset called temp:

data temp (keep=oldid sortind newid);

set A;

run;

It gives me a warning saying ...WARNING: The variable newid in the DROP, KEEP, or RENAME list has never been referenced ...and the dataset temp has no variable newid.

Could anyone tell me why its doing that?

Any suggestions would be very helpful.

Thanks!

Super User
Posts: 11,343

Re: WARNING: The variable in the DROP, KEEP, or RENAME list has never been referenced

I would double check spelling of the variable. Another possibility is that all values of newid are missing.

A proc sql solution that doesn't require a separate subsetting step.

proc sql;

     create table temp as

     select b.oldid, a.sortid, a.newid

     from b left join a on b.oldid=a.oldid;

quit;

Frequent Contributor
Posts: 124

Re: WARNING: The variable in the DROP, KEEP, or RENAME list has never been referenced

Thanks @ballardw I will work on your suggestions and use the left join...(The 'sortid/sortind' was a typo error here)

Ask a Question
Discussion stats
  • 2 replies
  • 1170 views
  • 1 like
  • 2 in conversation