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

Hi All,

 

I have list of variables in final data set and I don't want to display one variable. But I am using that variable in Sorting, so I can not drop that variable. Lets assume that variable name as 'Height'. 

 

So,

- I kept the variable in Keep statement and I have sorted it.

- Now I am using ODS statement and then I used Proc Print as below.

 

ods listing close;
ods excel file=" ./abc.xls " ;
title "Review &study ABC";
run;


proc print data=FINAL label noobs ;
var XX YY ZZ ; /*Though I am not keeping the variable ('Height') in VAR statement, I am still getting that variable in final output Excel file*/
run;  

 

Please suggest how can I drop it (Height) from final Output file ?

 

1 ACCEPTED SOLUTION

Accepted Solutions
andreas_lds
Jade | Level 19

@Hari2 wrote:
I tried it already and still I am getting the variable in Output Excel file.

Please post the full log.

View solution in original post

4 REPLIES 4
sustagens
Pyrite | Level 9

add it the drop statement after specifying the dataset name

proc print data=FINAL (drop=Height) label noobs;

 

Hari2
Quartz | Level 8
I tried it already and still I am getting the variable in Output Excel file.
andreas_lds
Jade | Level 19

@Hari2 wrote:
I tried it already and still I am getting the variable in Output Excel file.

Please post the full log.

Hari2
Quartz | Level 8
Hi , I was checking final dataset and it was there in that. I realized it now that we are removing in final Excel file as we are dropping in Proc Print, so it's working and I dont see it in the Output Excel file.

Thanks for your reply. 🙂

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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