DATA Step, Macro, Functions and more

Split a dataset into several datasets

Posts: 1

Split a dataset into several datasets



I have one dataset and I need to create several excel per variable.



Name  Code  Date of Birth  Country

John     18      10/10/1998      USA

John     20      01/11/2000      USA

Mike     22      10/10/2001      USA


I need to create one archive per name. And if it is possible, I need to compact the archive with password and send an e-mail.


Can you guys help me?


Super User
Super User
Posts: 9,423

Re: Split a dataset into several datasets

Posted in reply to ftatsukawa

So, you need to clarify your question.  What have you done to enact your requirements?

" need to create several excel per variable" - what does this mean?  To create files which can be opened in Excel, you could use ods tagsets.excelxp, libname Excel, ods excel, proc export, put to CSV etc. 

You say you need one archive, presuming this is a ZIP file, then you need access to your Operating Sstem.  You then call the exe file from your compressions software, e.g:
x 'c:\zip\winzip.exe "..." ""';

wher the elipses are the locatin of the output files to compress.  You could also use ods document if you have SAS 9.4.

Emails can be sent in datastep:


Simply put though, we are here to answer questions, not do the work in its entirety.  Have a go and come back if you have any troubles.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation