Closed rainermensing closed 2 months ago
Wow, that's a glaring inaccuracy! I'm going to have to get on whoever wrote that doc! (me). Thanks for catching that, and I'm sorry for the confusion. These are both just the SAS Dataset Options, not anything saspy implements. And, after 36 years of writing SAS, obs still trips me up when used with firstobs. Obs is really 'lastobs', not 'num of obs'. When used by itself (the 99% case for me), Num of obs == last obs. And I've never seemed to get it ingrained as 'lastobs'.
Curiously SPDS made up their own options for these, and it doesn't honor these; it has startobs
and endobs
.
Anyway, I'm sorry for the confusion and I'll update the doc with accurate values today!
@tomweber-sas thanks a lot for the fast response! No problem.
Ok, the doc should be correct now. I also noticed and fixed the comment in each of those from
first obs is a number - either string or int
to
firstobs is a number - either string or int
as firstobs is one word not two. Yet another doc typo. Again, thanks for letting me know about that. At least it's just the doc; the software works right! :)
Tom
I'll go ahead and close this. But if there's anything I missed, feel free to reopen. And there's anything else, please open another!
Thanks! Tom
I am using saspy==5.1.2 and python 3.10 on both Windows and Linux.
I want to paginate through a sas table using sasdata2dataframe. The documentation shows the pagination implementation as :![image](https://github.com/sassoftware/saspy/assets/31634583/ac45e09e-97f6-41e3-9fa8-2cf581ac67be)
From this I would take that obs = page size and firstobs = where to start page. So in this example, start from row 12 and read 10 rows.
However, when I try to test it with obs = 1M and firstobs = 1M +1, hence start from row 1M+1 and read 1m rows, I get ERROR FIRSTOBS > OBS![Errorr](https://github.com/sassoftware/saspy/assets/31634583/06f183bd-3aa2-4f33-ac98-b6675b2bf76c)
Thus, the current implementation is actually obs = how many rows should I read and firstobs = where is the cutoff point from which I should keep the records. The docs are a bit misleading in this case.