Obtain rows from a data set

post/sessions/{sessionId}/data/{libref}/{tableName}/rows
Internal-Use Only

Returns the rows for a specified data set based on the submitted request body. By default, a collection is returned, and standard paging options are available.

Request Samples

1

Response Samples

1{
2 "accept": "application/vnd.sas.compute.data.table.row",
3 "count": 49858,
4 "items": [
5 {
6 "cells": [
7 "AF-0101 ",
8 "AF-01 ",
9 1,
10 " 0.020917256889",
11 " 0.011839722373",
12 69.136845,
13 34.603907,
14 1,
15 4,
16 0
17 ]
18 },
19 {
20 "cells": [
21 "AF-0101 ",
22 "AF-01 ",
23 1,
24 " 0.021222359985",
25 " 0.011868170604",
26 69.158125,
27 34.605286,
28 0,
29 0,
30 0
31 ]
32 },
33 {
34 "cells": [
35 "AF-0101 ",
36 "AF-01 ",
37 1,
38 " 0.021485525757",
39 " 0.011762109322",
40 69.176348,
41 34.598996,
42 1,
43 5,
44 0
45 ]
46 }
47 ],
48 "limit": 3,
49 "links": [
50 {
51 "href": "/compute/sessions/RKEY-ses0000/data/MAPSGFK/AFGHANISTAN/rows?start=0&limit=3",
52 "itemType": "application/vnd.sas.compute.data.table.row",
53 "method": "GET",
54 "rel": "self",
55 "type": "application/vnd.sas.collection",
56 "uri": "/compute/sessions/RKEY-ses0000/data/MAPSGFK/AFGHANISTAN/rows?start=0&limit=3"
57 },
58 {
59 "href": "/compute/sessions/RKEY-ses0000/data/MAPSGFK/AFGHANISTAN/rows",
60 "itemType": "application/vnd.sas.compute.data.table.row",
61 "method": "GET",
62 "rel": "collection",
63 "type": "application/vnd.sas.collection",
64 "uri": "/compute/sessions/RKEY-ses0000/data/MAPSGFK/AFGHANISTAN/rows"
65 },
66 {
67 "href": "/compute/sessions/RKEY-ses0000/data/MAPSGFK/AFGHANISTAN/rows?start=3&limit=3",
68 "itemType": "application/vnd.sas.compute.data.table.row",
69 "method": "GET",
70 "rel": "next",
71 "type": "application/vnd.sas.collection",
72 "uri": "/compute/sessions/RKEY-ses0000/data/MAPSGFK/AFGHANISTAN/rows?start=3&limit=3"
73 },
74 {
75 "href": "/compute/sessions/RKEY-ses0000/data/MAPSGFK/AFGHANISTAN/rows?start=49855&limit=3",
76 "itemType": "application/vnd.sas.compute.data.table.row",
77 "method": "GET",
78 "rel": "last",
79 "type": "application/vnd.sas.collection",
80 "uri": "/compute/sessions/RKEY-ses0000/data/MAPSGFK/AFGHANISTAN/rows?start=49855&limit=3"
81 }
82 ],
83 "name": "Table Rows",
84 "start": 0,
85 "version": 2
86}

Path Parameters

NameTypeRequiredDescription
libref
string<object-id>
true

Specifies the libref for the request.

sessionId
string<object-id>
true

Specifies the ID of the session.

tableName
string<object-id>
true

Specifies the table or data set to query.

Query Parameters

NameTypeRequiredDescription
format
boolean
false

Specifies whether to format the data in the cells.

Default:
true
formatMissingValues
boolean
false

If set to true, SAS missing values found in the data will be formatted based on the setting of the SAS Option MISSING. Otherwise, a NULL value will be returned.

includeIndex
boolean
false

Specifies whether the first value in the cell is the index of a specific row. Support for this parameter was added in version 2.

Default:
false
limit
integer
false

Specifies the maximum number of rows to return.

Default:
100
returnNumAsString
boolean
false

If set to true, SAS numeric values found in the data will be returned as strings.

Default:
false
start
integer
false

Specifies the offset of the first row to return.

Default:
0

Request Body

Specifies a row-generation request.

Provides a request that you can use to obtain rows from a table or data set.

Example:
{"where":"name='Fred'","fileProtection":{"read":"cmVhZFBX","alter":"YWx0ZXJQVw==","write":"d3JpdGVQVw=="},"fileProtectionEncoding":"base64","columnFormatting":[[{"name":"Sex"},{"format":"$GENDER6."}]]}
NameTypeRequiredDescription
where
string
false

Specifies that a standard SAS WHERE clause was used to return the rows for this request.

fileProtection
Table Protection Information
false

Specifies information that you use to access data sets or tables that are protected. Provide password values in the format password-type=password. Possible values for password-type are "ALTER", "PW", "READ", or "WRITE". A password value must be a valid eight-character SAS name.

fileProtectionEncoding
string
false

Specifies the encoding for the password values in the fileProtection structure. If the value is "base64", then the password values in the fileProtection structure should be encoded by converting the text to UTF-8 and base64-encoding the result. If no value is provided, then the password values of the fileProtection structure are expected to be clear text.

columnFormatting
array [User Specified Column Formatting]
false

Specifies the formatting to be used for specified columns.

Responses

StatusMeaningDescription
200OKThe request succeeded.Schema
400Bad RequestThe request was invalid.Schema
404Not FoundNo resource exists at the requested path.Schema