DATA Step, Macro, Functions and more

a SAS loop that imports XML

Reply
New Contributor
Posts: 2

a SAS loop that imports XML

I never worked with XML data before, but are trying to make a loop that imports a folder full of XML files into SAS.

 

I took over the program below, but realises that I get a problem, when I have to import other variables from the file then the two already in use, since some dont have a fixed length.

 

%macro loop;

%do n=1 %to &no;

data import;

infile "Z:\&&filnavn_&n" LRECL=9999 SCANOVER;
input @'<Review>' +9 medlemnr $9. +20 artikel $10.@@;

run;

proc append base = lookup.review_01 data = import; run;

%end;

%mend loop;

%loop;

 

Any sugestions?

Super User
Super User
Posts: 7,395

Re: a SAS loop that imports XML

You would be better off looking at the SAS XML Mapper software and the libname xml, rather than trying to write an XML parser yourself:

http://support.sas.com/rnd/base/xmlengine/

 

New Contributor
Posts: 2

Re: a SAS loop that imports XML

Probably, but I dont think I have access to that solution, otherwise I would.

Super User
Super User
Posts: 7,395

Re: a SAS loop that imports XML

Ask a Question
Discussion stats
  • 3 replies
  • 181 views
  • 1 like
  • 2 in conversation