Hi,
I am looking for a way of creating a list of SAS reports and their parent locations. I guess the way to go is to search for the folders where the reports are by using REST API calls, but I could not find a way of developing a SAS job for it.
Report | Folder |
Report1 | /User/Project/Reports |
Report2 | /User/Project/Reports |
Report3 | /User/MyFolder/Test |
Report4 | /Apps/SAS/Data |
Have a look here https://developer.sas.com/apis/rest/CoreServices/#get-a-resource-39-s-ancestors to get the folder information of a report
SAS sample code looks like:
proc http
url="&BASE_URI/folders/ancestors?childUri=/reports/reports/72c7e418-cd68-49c7-8f2f-6e9548639821"
method='GET'
oauth_bearer=sas_services
out=resp
;
run;
%put NOTE: resp json pretty print;
%put %sysfunc( jsonpp(resp, log));
libname resp json fileref=resp;
proc copy in=resp out=work;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.