When using SAS GRID / Cloud (both SAS EG 9.4), we used to have the functionality of Ctrl+G to open 'Go To Cell' then we're able to enter the row number we want to go to and it just takes users to that specific observation.
But in SAS Studio, this functionality is gone. To make matters worse, the maximum number of observations you can see on a single page is only 500 observations.
I'm having real difficulty using SAS Studio because of this - is this functionality hidden somewhere that I am not aware of?
Or is the only solution to set the dataset to a new dataset and add a variable to display _n_ then use it to filter?
Beginning with SAS Studio 5.2, we provide the ability to view up to 1000 rows per page. This option is not available with SAS Studio 3.x versions.
Providing the ability to go directly to a row within a table is a feature request that development has on their to-do list.
Currently, you would need to use data step logic to go to a specific row in a table. The data step below creates a new data set that begins with the 6th observation in the table.
data new;
set sashelp.class;
if _n_> 5;
run;
Beginning with SAS Studio 5.2, we provide the ability to view up to 1000 rows per page. This option is not available with SAS Studio 3.x versions.
Providing the ability to go directly to a row within a table is a feature request that development has on their to-do list.
Currently, you would need to use data step logic to go to a specific row in a table. The data step below creates a new data set that begins with the 6th observation in the table.
data new;
set sashelp.class;
if _n_> 5;
run;
Thank you, hopefully development team will be implementing this important feature back in.
This greatly helps in proc compare where the discrepancy lies in 10000+ row but you can't directly go to that row to see the issue in detail unless you go through datastep filters.
Correct!
I would like to go view nth record directly. Currently I have to keep scrolling till that record comes but can I go to a particular number of (nth) record directly? It will be a great feature if it could be implemented.
Thank you.
- Dr. Abhijeet Safai
You can always isolate just one observation (x) and print it with the following:
proc print data=sashelp.class(firstobs=x obs=x);
run;
"Specific observation" can have more than one meaning. You seem to imply that you want a specific observation number. If that is the case do you want any more of the data set or just that observation?
Another data step approach is to use the FIRSTOBS dataset option. The following shows the data set starting with the 5th observation in the source set.
data temp; set sashelp.class (firstobs=5); run;
If you want only that obs couple it with the OBS= option:
data temp; set sashelp.class (firstobs=5 obs=5); run;
Another meaning of "specific observation" is observations with specific values of a variable, which I find more useful than the observation number approach because data sets get sorted, have observations dropped or added and the "number" changes. A Where statement can find all the observations with combinations of specific values.
data temp; set sashelp.class; where age=12; run;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.