Create a data set view

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

Returns a view of the specified data set. The request body that you provide controls the view that is created. You can then access the returned view as a table.

Request Samples

1

Response Samples

1{
2 "bookmarkLength": 12,
3 "compressionRoutine": "NO",
4 "modifiedTimeStamp": "2018-05-04T18:02:27.780000Z",
5 "creationTimeStamp": "2018-05-04T18:02:27.749000Z",
6 "engine": "V9",
7 "id": "TD0C00542_6305_8A4C_1C893A622C0C",
8 "label": "AFGHANISTAN - Source: GfkGeoMarketing - 2012 ",
9 "libref": "MAPSGFK",
10 "encoding": "Default",
11 "links": [
12 {
13 "href": "/compute/sessions/RKEY-ses0000/data/$VIEWS/TD0C00542_6305_8A4C_1C893A622C0C",
14 "method": "GET",
15 "rel": "self",
16 "type": "application/vnd.sas.compute.data.table",
17 "uri": "/compute/sessions/RKEY-ses0000/data/$VIEWS/TD0C00542_6305_8A4C_1C893A622C0C"
18 },
19 {
20 "href": "/compute/sessions/RKEY-ses0000/data/$VIEWS/TD0C00542_6305_8A4C_1C893A622C0C",
21 "method": "GET",
22 "rel": "alternate",
23 "type": "application/vnd.sas.compute.data.table.summary",
24 "uri": "/compute/sessions/RKEY-ses0000/data/$VIEWS/TD0C00542_6305_8A4C_1C893A622C0C"
25 },
26 {
27 "href": "/compute/sessions/RKEY-ses0000/data/$VIEWS/TD0C00542_6305_8A4C_1C893A622C0C/rows",
28 "itemType": "application/vnd.sas.compute.data.table.row",
29 "method": "GET",
30 "rel": "rows",
31 "type": "application/vnd.sas.collection",
32 "uri": "/compute/sessions/RKEY-ses0000/data/$VIEWS/TD0C00542_6305_8A4C_1C893A622C0C/rows"
33 },
34 {
35 "href": "/compute/sessions/RKEY-ses0000/data/$VIEWS/TD0C00542_6305_8A4C_1C893A622C0C/rows",
36 "method": "GET",
37 "rel": "rowsAsCSV",
38 "type": "text/csv",
39 "uri": "/compute/sessions/RKEY-ses0000/data/$VIEWS/TD0C00542_6305_8A4C_1C893A622C0C/rows"
40 },
41 {
42 "href": "/compute/sessions/RKEY-ses0000/data/$VIEWS/TD0C00542_6305_8A4C_1C893A622C0C/rowSet",
43 "method": "GET",
44 "rel": "rowSet",
45 "type": "application/vnd.sas.compute.data.table.row.set",
46 "uri": "/compute/sessions/RKEY-ses0000/data/$VIEWS/TD0C00542_6305_8A4C_1C893A622C0C/rowSet"
47 },
48 {
49 "href": "/compute/sessions/RKEY-ses0000/data/$VIEWS/TD0C00542_6305_8A4C_1C893A622C0C/columns",
50 "itemType": "application/vnd.sas.compute.data.table.column",
51 "method": "GET",
52 "rel": "columns",
53 "type": "application/vnd.sas.collection",
54 "uri": "/compute/sessions/RKEY-ses0000/data/$VIEWS/TD0C00542_6305_8A4C_1C893A622C0C/columns"
55 }
56 ],
57 "logicalRecordCount": -1,
58 "name": "TD0C00542_6305_8A4C_1C893A622C0C",
59 "columnCount": 1,
60 "rowCount": -1,
61 "physicalRecordCount": -1,
62 "recordLength": 88,
63 "type": "VIEW",
64 "version": 1
65}

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.

Request Body

Specifies a view creation request.

Provides a request that you can use to create a view on a table or data set.

Example:
{"where":"name='Fred'","fileProtection":{"read":"cmVhZFBX","alter":"YWx0ZXJQVw==","write":"d3JpdGVQVw=="},"fileProtectionEncoding":"base64","includeColumns":["name"],"columnNaturalOrder":true,"sortBy":[{"key":"name","direction":"ascending"}],"distinct":false}
NameTypeRequiredDescription
where
string
false

Specifies that a standard SAS WHERE clause was used to select the data for this view.

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.

includeColumns
array [string]
false

Specifies an array of strings that indicate the columns to include in the row set. If no value is specified, then all columns are returned.

columnNaturalOrder
boolean
false

When includeColumns is specified, a value of true for columnNaturalOrder specifies that the cells of the row set are returned in the order in which they occur in the data set instead of in the order that is specified by includeColumns.

sortBy
array [Table Sorting Request]
false

Specifies an array of objects that describe the sort definitions to use for this row set.

distinct
boolean
false

Specifies whether to select only distinct values for the view.

Default:
false

Responses

StatusMeaningDescription
201CreatedA view was created.HeadersSchema
400Bad RequestThe request was invalid. The view could not be created.Schema
404Not FoundNo resource exists at the requested path.Schema