How do I export / create a .xml file pr. customer

Reply
New Contributor
Posts: 3

How do I export / create a .xml file pr. customer

  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

Super User
Posts: 7,405

Re: How do I export / create a .xml file pr. customer

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
New Contributor
Posts: 3

Re: How do I export / create a .xml file pr. customer

Thanks for input :-)

Super User
Super User
Posts: 7,695

Re: How do I export / create a .xml file pr. customer

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.

Super User
Posts: 9,865

Re: How do I export / create a .xml file pr. customer

libname x xmlv2 '/folders/myfolders/class.xml' ;
proc copy in=sashelp out=x noclone;
 select class;
run;
Ask a Question
Discussion stats
  • 4 replies
  • 121 views
  • 0 likes
  • 4 in conversation