Published on :
File Management CREATION_INTERNE

SAS Viya Platform Files Service

This code is also available in: Deutsch Español Français
This document describes how the SAS© Viya file service works. It explains how files are stored and accessed via a unique identifier (UUID). Although there is no concept of 'folders' in this service, it is possible to associate files by using the PARENTURI= option, which specifies a relative URI for an object in the SAS© Viya platform. This allows for the creation of file collections.
Data Analysis

Type : CREATION_INTERNE


The example uses internal data from the SASHELP library (sashelp.class).

1 Code Block
DATA STEP
Explanation :
This example shows how to create a file named 'class.csv' using the DATA step and store it in the SAS Viya file service. The file is attached to a specific job execution, identified by its 'parenturi'. The file content is generated from the 'sashelp.class' table, with 'name', 'sex', 'age', 'height', and 'weight' variables exported in CSV format. The FILENAME statement with FILESRVC access is used to interact with the file service.
Copied!
1filename jobout filesrvc
2 parenturi='/jobExecution/jobs/5a308aa7-1c3a-4465-a14c-fd69a9091926';
3DATA _null_;
4 SET sashelp.class;
5 file jobout('class.csv');
6 put name "," sex "," age "," height "," weight;
7RUN;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.