I want to know on what way it's possible to copy a .flw file from the filesystem to SAS Content folder in Viya.
I've tried to use a binary copy (fcopy lrec=n) but this results in het corrupt flow in de SAS Content folder,
Hello,
Not sure why FCOPY does not work.
You could try fget and fput and fwrite like done here:
How to use SAS DATA step to copy a file from anywhere?
By Chris Hemedinger on The SAS Dummy June 17, 2011
https://blogs.sas.com/content/sasdummy/2011/06/17/how-to-use-sas-data-step-to-copy-a-file-from-anywh...
Just make sure to use FILESRVC Access Method on FILENAME Statement when referring to SAS Content folder!
Like here :
filename myfldr2 filesrvc folderpath='/Shared Data/Sales' filename='sales.csv';
Koen
I've the same question. I make use indeed of filesrc and i'am aware over de .csv-example documented by SAS.
When you copy with the same method a .flw file to the sas content you can see that the file is copied to the sas content but the .flw-file wil not open as a flow in sas content.
My goal is to copy a working sas studio flow which is saved on the filesystem copy via sas-code to the sas contents which should result in het working flow (on the sas content)
@MAGDN wrote:
When you copy with the same method a .flw file to the sas content you can see that the file is copied to the sas content but the .flw-file wil not open as a flow in sas content.
Hello,
Koen
Hi Koen,
Thank you for your questions. Hereby the warning i'am getting
Not a timely response, but I too have looked into how to copy dataFlow and will comment on the results.
I was able to save the flow as a file using PROC HTTP. Here is a sample code of it.
/* Copy dataFlow to the directory */ %macro copyDataFlow(uri=, to=); %global rc; %local fref url n; %let rc=1; %let n=%sysfunc(monotonic()); %let fref=_LF%sysfunc(putn(&n, z5.)); %let url=%sysfunc(getoption(SERVICESBASEURL))&uri; /* Assign file reference name. */ filename &fref "&to" encoding='UTF-8'; %if &sysfilrc^=0 & &sysfilrc^=1 %then %return; proc http method="GET" oauth_bearer=sas_services out=&fref url="&url"; run; %if &SYS_PROCHTTP_STATUS_CODE=200 %then %do; %let rc=0; %end; filename &fref clear; %mend;
%copyDataFlow(uri=/dataFlows/dataFlows/a96a3d9d-61cd-4f18-bdca-4149251f3d5a, to=/tmp/sample.flw);
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.
Ready to level-up your skills? Choose your own adventure.