SAS Programming

DATA Step, Macro, Functions and more
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-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 3330 views
  • 0 likes
  • 3 in conversation