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

Hello,

I have the following code in SAS Base 9.2:

PROC PRINT DATA = myDataSet;

VAR var1 var2 var3 var4;

WHERE var1 <12 and var11 = 'bad';

RUN;

As a result I get a table with the columns (variables): Obs, var1, var2, var3, var4.

Is there a way for me to hide the Obs column?

Thank you,

P.

1 ACCEPTED SOLUTION

Accepted Solutions
AncaTilea
Pyrite | Level 9

Smiley Happy

You can use "NOOBS"

PROC PRINT DATA = myDataSet NOOBS;

....;

RUN;

Smiley Happy

View solution in original post

5 REPLIES 5
AncaTilea
Pyrite | Level 9

HI.

I am not sure there is a way to remove that column.

But you could do something like this, instead:

PROC SQL;

    SELECT VAR1, VAR2, VAR3,VAR4

    FROM myDataSet

     WHERE var1 <12 and var11 = 'bad';

QUIT;


Or, if you want to copy/paste the output from the PROC PRINT, you could do the following:

move the cursor all the way to down-right corner of the output.As you hold down the "Alt" key you can highlight only desired columns from a SAS output - see attached.

Good luck,

Anca.


print_output.bmp
pmdci
Fluorite | Level 6

Hello,

Thank you for the reply. But I'm afraid that I must hide the Obs column using code, and I am not supposed to be doing a PROC SQL -- it must be a PROC PRINT.

Regards,

P.

AncaTilea
Pyrite | Level 9

Smiley Happy

You can use "NOOBS"

PROC PRINT DATA = myDataSet NOOBS;

....;

RUN;

Smiley Happy

pmdci
Fluorite | Level 6

Yep. That's it! Thanks a lot Anca!

Sagattiger
Calcite | Level 5

Thank you. it worked.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 31606 views
  • 7 likes
  • 3 in conversation