Hello! I need to copy attachments associated with risk events from EGRC 6.1 to a folder. There are about 300 risk events that i need to copy the attachments. How can I do this through SAS code? My sample code (some code was obtained from the community) proc sql noprint;
select t1.BUSINESS_OBJECT_RK into: rk saperated by '-'
FROM SASOPRSK.ATTACHMENT_L t1, SASOPRSK.OP_RISK_EVENT_L t2, SASOPRSK.DIM_POINT_L t3
WHERE (t1.SOURCE_SYSTEM_CD = t2.SOURCE_SYSTEM_CD AND t1.BUSINESS_OBJECT_RK = t2.OP_RISK_EVENT_RK AND t2.DIM_POINT_RK = t3.DIM_POINT_RK) AND t1.ATTACHMENT_TYPE_CD ne "LNK" and (t1.BUSINESS_OBJECT_NM = 'OP_RISK_EVENT' AND t3.AUX_RMG_DIM_1_RK = 10023);
select FILE_NM into: file saperated by '-'
FROM SASOPRSK.ATTACHMENT_L t1, SASOPRSK.OP_RISK_EVENT_L t2, SASOPRSK.DIM_POINT_L t3
WHERE (t1.SOURCE_SYSTEM_CD = t2.SOURCE_SYSTEM_CD AND t1.BUSINESS_OBJECT_RK = t2.OP_RISK_EVENT_RK AND t2.DIM_POINT_RK = t3.DIM_POINT_RK) AND t1.ATTACHMENT_TYPE_CD ne "LNK" and (t1.BUSINESS_OBJECT_NM = 'OP_RISK_EVENT' AND t3.AUX_RMG_DIM_1_RK = 10023);
quit;
%macro attachment;
proc sql noprint;
select count(*) into: count
FROM SASOPRSK.ATTACHMENT_L t1, SASOPRSK.OP_RISK_EVENT_L t2, SASOPRSK.DIM_POINT_L t3
WHERE (t1.SOURCE_SYSTEM_CD = t2.SOURCE_SYSTEM_CD AND t1.BUSINESS_OBJECT_RK = t2.OP_RISK_EVENT_RK AND t2.DIM_POINT_RK = t3.DIM_POINT_RK) AND t1.ATTACHMENT_TYPE_CD ne "LNK" and (t1.BUSINESS_OBJECT_NM = 'OP_RISK_EVENT' AND t3.AUX_RMG_DIM_1_RK = 10023);
quit;
%do i = 1 %to &count;
*filename out temp;
%let rk_l=%scan(%bquote(&rk), %bquote(&i) ,%str(-));
%let file_l=%scan(%bquote(&file), %bquote(&i) ,%str(-));
options dlcreatedir;
libname newdir "E:/anexos"; libname pasta "E:/anexos/&rk_l"; filename out "E:/anexos/&rk_l/&file_l";
libname newdir clear;
libname pasta clear;
proc http
method="get"
url="http://lqc6001sas05.unix.grupo.com:7980/SASContentServer/repository/default/sasdav/Products/SASEnterpriseGRC/EnterpriseGRCMidTier6.1/Content/op_risk_event/&rk_l/&file_l"
webUserName="sasadm@saspw"
webPassword="****"
out=out;
run;
%end;
%mend;
%attachment;
With this code I get the error: HTTP Status 404 The requested resource is not available Thank you in advance for your help, Jorge
... View more