BookmarkSubscribeRSS Feed
henrik_liebach
Calcite | Level 5

  Hi

 

I'm a new in SAS, and got a challage to make a script where output is add at one .xml for each customer.

 

I don't know if it's possibel for SAS to create / export .xml file for each customer?

If yes, please add more than one expempel to me.

 

Thx in advance.

 

Regards

Henrik

4 REPLIES 4
Kurt_Bremser
Super User

Please provide example data (analytic source data, and how the list of customers is stored in SAS) to play around (use data steps as described here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...), show how the data is prepared for each customer, and give an example for the .xml file format in question.

henrik_liebach
Calcite | Level 5

Thanks for input 🙂

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Without having anything to work with this is just an example:

data _null_;
  set subjects;
  by subject;
  if first.subject then call execute('data _null_; set have; file "subject'||strip(subject)||'.xml";');
  call execute('put "<subject>'||strip(subject)||'<subject>";');
  if last.subject then call execute('run;');
run;

Alll the above does is create a file per subject and put the text with subject in each.

Ksharp
Super User
libname x xmlv2 '/folders/myfolders/class.xml' ;
proc copy in=sashelp out=x noclone;
 select class;
run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 405 views
  • 0 likes
  • 4 in conversation