sI tried to convert two xpt file called "ae.xpt" and "se.xpt" into sas file called ae and se as well. The original file was saved at "D:\sdtm\data_xpt", and I want the converted sas file to be saved at "D:\sdtm\data_sas".
Here was my code, but it didn't work:
libname sasfiles 'D:\sdtm\data_sas';
%let Root=D:\sdtm\data_xpt;
%xpt2loc(libref=sasfiles, memlist=ae, filespec='&root\ae.xpt');
%xpt2loc(libref=sasfiles, memlist=se, filespec='&root\se.xpt');How to write the correct one? Thanks!
The macro processor will ignore strings that are bounded with single quote characters (apostrophes).
Use double quote characters instead.
You probably don't need to limit the list of members to extract. If the XPT file only has one member then there is no difference. If it has multiple members then why do you only want one of them?
%let Root=D:\sdtm\data_xpt;
%xpt2loc(libref=sasfiles, filespec="&root\ae.xpt");
libname sasfiles 'D:\sdtm\data_sas' ; filename x 'D:\sdtm\data_xpt\ae.xpt' ; %xpt2loc(libref=sasfiles, filespec=x )
The macro processor will ignore strings that are bounded with single quote characters (apostrophes).
Use double quote characters instead.
You probably don't need to limit the list of members to extract. If the XPT file only has one member then there is no difference. If it has multiple members then why do you only want one of them?
%let Root=D:\sdtm\data_xpt;
%xpt2loc(libref=sasfiles, filespec="&root\ae.xpt");
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.