Hi - How to hide Obs column in proc sql. Thanks.
Exactly what are you looking at when you see an OBS column in PROC SQL? Please show us a screen capture.
I get the obs column number as 1 2 3 4 ...for each row. When the report is exported to excel I get the number. Please see the attached. Thanks.
Example :
field name1 fieldname2 fieldname 3
1 value value value
2 value value value
3 value value value
4 value value value
5 value value value
I don't understand. You posted a picture of something in a SAS browser window.
Not a dataset. Not an output. Not an Excel file.
Attached again. Can you see the output?
Many of us will not (or cannot) download and open Microsoft Office documents because they are security risks. Better to include the screen capture in your reply, by clicking on the "Photos" icon.
Again that just looks like a photo of the data browsing window in SAS/Studio.
I see the screen shot if I download it though.
If you run the below code you could see the obs number (1st column) 1 2 3 4 ..I want to get rid of those numbers.
proc sql nonumber;
create table test as select * from sashelp.class;
run;
@DLROW wrote:
I see the screen shot if I download it though.
If you run the below code you could see the obs number (1st column) 1 2 3 4 ..I want to get rid of those numbers.
proc sql nonumber;
create table test as select * from sashelp.class;
run;
Nope. It DOES NOT create any OBS NUMBER variable.
It makes the exact same dataset as if you just used a normal data step.
data test2;
set sashelp.class;
run;
Yes, it is not a variable but we do see the row numbers as 1 2 3 .... before the column 'Name'.
output :
Name Sex Age Height Weight
1 Alfred M 14 69 112.5
2 Alice F 13 56.5 84
3 Barbara F 13 65.3 98
You are looking at a screen designed to let your browse a dataset. That does not have anything to do with PROC SQL or anything to do with OUTPUT.
If you open an Excel file in Excel it will also show you line numbers (and column letters).
If you want the observation number to not show in output then use appropriate options for that. NOOBS in PROC PRINT and NONUMBER in PROC SQL.
Thanks for your reply Tom.
Have you created the stored process and run the report from SAS Report tab (through EXCEL SAS ADDIN) ? If so , please try that.
How do you attach the results here. I am not able to.
proc sql nonumber;
select * from sashelp.class;
run;
Still I get the number if I create the table. When this report is run from SAS Reports (Excel SAS Addin) this number is also being populated in an excel.
Code:
proc sql nonumber;
create table test as select * from sashelp.class;
run;
Not sure what the add-in to Excel is doing. But if you are using Excel shouldn't your screen shot look like an Excel sheet?
Also your code does NOT look like a report. It is just a step to create a dataset. Nothing in that code to produce any report to be copied to Excel.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!