This xml file comes from 'Title.xlsx'. In order to import this xml file, I have created a mapper file(test.map). SAS code: filename xlsx2xml '~\xml-sas\Titles222.xml'; filename SXLEMAP '~\xml-sas\test.map'; libname xlsx2xml xmlv2 xmlmap=SXLEMAP access=READONLY; data sheet; set xlsx2xml.final; run; The dataset I got is shown as data.png. I did some simple data processing to get what I want in the end like data1.png. My question is, is there a way to add some code to the mapper file(test.map), so that I do not need these data processing in sas and can directly get the dataset I want (data1.png)?
You are over-complicating things. I got your intended result by doing this:
libname titles xlsx '/folders/myfolders/Titles.xlsx';
data want;
length sheet $32;
set titles.sheet: indsname=dname;
sheet = scan(dname,2,'.');
run;
You are over-complicating things. I got your intended result by doing this:
libname titles xlsx '/folders/myfolders/Titles.xlsx';
data want;
length sheet $32;
set titles.sheet: indsname=dname;
sheet = scan(dname,2,'.');
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.