Generates code for an item at the given location

post/code
Internal-Use Only

Given the location of a SAS program or the Studio flow file, return the code that SAS Studio would run.

Request Samples

1

Response Samples

1{
2 "code": "data work.foo; set sashelp.class; run;"
3}

Query Parameters

NameTypeRequiredDescription
sessionId
string
false

If referencing a file on the compute file system, use this session id to access the file. If not provided, a session will be created in the default SAS Studio compute context to access the file.

Request Body

The code generation request.

Describes how to generate the code, including flags to customize the generation. Flow or code must be provided either via a reference, or directly via an object. If no reference nor object is provided, it returns an error. It also returns an error when both are provided.

NameTypeRequiredDescription
reference
externalReference
false

A pointer to an object in SAS Content, on the SAS Compute Server, or in a service.

object
sourceObject
false

Flow or code that will be used to generate the result. If this is a flow, it will be the raw contents of a flow created in SAS Studio, and will look like JSON data. If this is code, it will be the actual SAS code.

initCode
boolean
false

Indicates whether to include the initialization code for the SAS Studio session.

wrapperCode
boolean
false

Indicates whether to include the wrapper code for the SAS Studio request.

Responses

StatusMeaningDescription
200OKThe generated code.Schema
400Bad RequestBad request. The request body had invalid input.