Discover More Tips and Techniques on This Blog

How to Create a new data set from multiple data sets based upon sorted order

Create a new data set from multiple data sets based upon sorted order

Use the SET and BY statements to interleave data sets.

Note: Interleaving uses a SET statement and a BY statement to create a new, sorted data set from multiple data sets. The number of observations in the new data set is the sum of the number of observations in the original data sets. The observations in the new data set are arranged by the values of the BY variable(s) and, within each BY-Group, the order of the data sets in which they occur, including duplicates.

To interleave, data sets need to be in sorted order or indexed on the BY variables.



Output:
source: support.sas.com

2 comments:

  1. I like to give my sincere thanks to make a blog for sas discussion,but i like to stick to the old format that you made in the sas9.blogspot.com.if you make the same format here that will be a good one...

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete

Disclosure:

In the spirit of transparency and innovation, I want to share that some of the content on this blog is generated with the assistance of ChatGPT, an AI language model developed by OpenAI. While I use this tool to help brainstorm ideas and draft content, every post is carefully reviewed, edited, and personalized by me to ensure it aligns with my voice, values, and the needs of my readers. My goal is to provide you with accurate, valuable, and engaging content, and I believe that using AI as a creative aid helps achieve that. If you have any questions or feedback about this approach, feel free to reach out. Your trust and satisfaction are my top priorities.