Hello,
I am using a macro funtion to download an xml file from a web site. It was working properly but since few days, we have the following errors. How do we solve that kind of issue?
ORDERDATE=20240701 ORDERTIME=080000 SURVEYNAME=BROKERS_QUEBEC_SURVEYS_RESPONSES " BROKERS_QUEBEC_SURVEYS_RESPONSES" 'you are an authorized user in stha8n09z' SYS_PROCHTTP_STATUS_CODE=200 { "access_token": "51ebfa1c-7c45-4305-9658-9fa0008d91b3", "token_type": "Bearer", "expires_in": 3599, "scope": "manage:all" } BEARERTOKEN=...0008d91b3 BTEXPIN= 3599 BEARERTIMER_START=2035560918.51997 "===================================================================" SURVEYID=SV_0vnXEeLgN8B46bA ZNAME=Zfile13 "===========WE ARE STARTING TO PROCESS SURVEY SV_0vnXEeLgN8B46bA ===========" "========================== PROGRESSID=ES_aVJxgqv3peSjDkG ==========================" PSTATUS=inProgress PSTATUS=inProgress PSTATUS=inProgress PSTATUS=complete FILEID=c33612d3-e2dd-45d1-bef4-aeee06e12397-def Archive: /finsys/.../data/Zfile13.zip inflating: /finsys/.../data/Virage Survey.xml XMLFILE=Virage Survey.xml XMLFILE2=VirageSurvey.xml XMLMAP2=VirageSurvey.map FILE_PATH=/finsys/.../data ERROR: Some code points did not transcode. occurred at or near line 160740, column 109 ERROR: XML parsing error. Please verify that the XML content is well-formed. ERROR: File WORK.Response.DATA has not been saved because copy could not be completed. ERROR: Some code points did not transcode. occurred at or near line 160740, column 109 ERROR: XML parsing error. Please verify that the XML content is well-formed. ERROR: File WORK.Responses.DATA has not been saved because copy could not be completed.
Partial code inside a macro function:
filename oscmd pipe "unzip -d &file_path. -jo &file_path./&Zname..zip";
data _null_;
infile oscmd;
input;
put _infile_;
run;
/******* Get the xml file name********/
Filename adb_xml pipe "ls -Art &file_path./*.xml | tail -n 1 ";
DATA xml_filelist;
Infile adb_xml truncover;
Input infile_name $100.;
Filename=scan(infile_name,-1,"/","b");
call symput ('xmlFile',strip(Filename));
call symput ('cn_xmlFile1',strip(infile_name));
RUN;
/** Declaring other macro variables
Please don't move those macro. They need the value of xmlFile from the
above call symput statement ***/
%let xmlFile2=%sysfunc(compress(&xmlFile));
%let xmlMap2=%substr(&xmlFile2.,1,%length(&xmlFile2.)-4).map;
%put &=xmlFile;
%put &=xmlFile2;
%put &=xmlMap2;
%put &=file_path.;
/** Renaming the XML File with SAS standard (no space in the file name) ***/
filename oscmd pipe "mv ""&file_path./&xmlFile."" ""&file_path./&xmlFile2."" 2>&1";
data _null_;
infile oscmd;
input;
put _infile_;
run;
/********** Creating the map file ***************/
filename datafile "&file_path./&xmlFile2.";
filename mapfile "&file_path./&xmlMap2.";
libname datafile xmlv2 xmlmap=mapfile automap=replace;
proc copy in=datafile out=work;
run;
%goto exit;
Errors appears when the proc copy is executed
... View more