Examples use SASHELP data (sashelp.class) for file creation.
1 Code Block
DATA STEP
Explanation : This example shows how to create a 'class.csv' file from the 'sashelp.class' table using a DATA step. The file is then attached to a specific job using the PARENTURI= option of the FILENAME FILESVC statement. The file service uses this URI to link the output file to the job with identifier '5a308aa7-1c3a-4465-a14c-fd69a9091926'. Each row of 'sashelp.class' is formatted as CSV and written to the 'class.csv' file.
Copied!
filename jobout filesrvc
parenturi='/jobExecution/jobs/5a308aa7-1c3a-4465-a14c-fd69a9091926';
data _null_;
set sashelp.class;
file jobout('class.csv');
put name "," sex "," age "," height "," weight;
run;
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.
« When utilizing the File Service, prioritize the UUID over the filename for programmatic access. Because the service allows non-unique names, relying on filenames can lead to retrieval errors in automated workflows.
To maintain organization without a traditional folder structure, use the PARENTURI= option to logically group files under a specific object, such as a Job Execution. This ensures your outputs remain contextually linked to their source and are easily retrievable within the SAS Viya ecosystem. »
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.