BookmarkSubscribeRSS Feed
xda1
Calcite | Level 5

Hi, I am a student new to SAS Viya.

I have already built and published a model, I wish to know how to transfer data in JSON format from other sources into the model I built in SAS viya and get results.

i have looked into the RESTful APIs and SAS Viya CLI contents, and have a general idea of how to export/import/ transfer data. BUt i am still very lost over how do i apply my deployed model on the data.

 

It will be great if anyone can help me with the question. thank you!

1 REPLY 1
HarrySnart
SAS Employee

Hi @xda1 , can you please elaborate on how your model is currently deployed? Also is inference for batch or record level? If you're trying to use JSON data as an input for a VDMML model for record level inference, you typically score your model via REST. You'll need to construct the data for the POST request with the inputs and values for the independent variables in your model. If your data is already in JSON format you may be able to use it directly, however you'll need to validate if the structures are the same. It may be that you need to parse the JSON data and populate the body of the REST call. 

 

For parsing JSON in SAS you can use a few approaches. The JSON libname is convenient, DS2 will also allow you to parse the key-value pairs and output directly to a dataset or macro variable. Scoring could be done with PROC HTTP.

 

Likewise, you can do this with a scripting language like Python as the request will be via REST anyway.

Thanks

Harry