<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I fill the variables with data from 2 datasets more a list loop in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-fill-the-variables-with-data-from-2-datasets-more-a/m-p/816011#M322060</link>
    <description>Maybe you should try a join then use Proc Transpose.</description>
    <pubDate>Wed, 01 Jun 2022 09:20:04 GMT</pubDate>
    <dc:creator>DartRodrigo</dc:creator>
    <dc:date>2022-06-01T09:20:04Z</dc:date>
    <item>
      <title>How do I fill the variables with data from 2 datasets more a list loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-fill-the-variables-with-data-from-2-datasets-more-a/m-p/815974#M322046</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Hello,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;I'm new on SAS and I'd like to do this:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;I have this three datasets:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Dataset01 (DS1):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Id&amp;nbsp; | Begin_date | End_date&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;d&amp;nbsp; &amp;nbsp;|01jun2022&amp;nbsp; &amp;nbsp;|10jun2022 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;b&amp;nbsp; &amp;nbsp;|02jun2022&amp;nbsp; &amp;nbsp;|06jun2022&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;c&amp;nbsp; &amp;nbsp;|02jun2022&amp;nbsp; &amp;nbsp;|07jun2022&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Dataset02 (ds2):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;05/06/2021 |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;06/06/2021 |&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Dataset03 (ds3):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;id |max_days |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;a&amp;nbsp; |3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;b&amp;nbsp; |3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;c&amp;nbsp; |2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;d&amp;nbsp; |2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;e&amp;nbsp; |4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;f&amp;nbsp; |5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;g&amp;nbsp; |2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;h&amp;nbsp; |3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;i&amp;nbsp; |4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;j&amp;nbsp; |2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;k&amp;nbsp; |4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;l&amp;nbsp; |4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;m&amp;nbsp; |3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;n&amp;nbsp; |3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;o&amp;nbsp; |5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;p&amp;nbsp; |4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;q&amp;nbsp; |3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;r&amp;nbsp; |3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Output condition.a1: every day of the year is one row&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Output condition.a2: each day must have 7 ids on the row&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;What i'd like to do is this:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;a.Fill the variables with the ids from Dataset01, daily;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;b.If the number of ids for one day is not enough, fill with ids from Dataset02&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Condition.b1. can't repeat the same id on a day&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Condition.b2. max number of times the id can fill the blanks before pass to next id: Dataset03.max_days&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Condition.b3. days listed on Dataset02 do not count for the condition.b2 (above)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;c.When the list of ids (Dataset03) is over, start again from the beggining.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Output wanted:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Date&amp;nbsp; &amp;nbsp; &amp;nbsp; |var_01&amp;nbsp; |var_02&amp;nbsp; |var_03&amp;nbsp; |var_04&amp;nbsp; |var_05&amp;nbsp; |var_06&amp;nbsp; |var_07&amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;01jun2022 | d(DS1) | a(ds3) | b(ds3) | c(ds3) | e(ds3) | f(ds3) | g(ds3) |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;02jun2022 | d(DS1) | b(DS1) | c(DS1) | a(ds3) | e(ds3) | f(ds3) | g(ds3) |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;03jun2022 | d(DS1) | b(DS1) | c(DS1) | a(ds3) | e(ds3) | f(ds3) | h(ds3) |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;04jun2022 | d(DS1) | b(DS1) | c(DS1) | e(ds3) | f(ds3) | h(ds3) | i(ds3) |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;05jun2022 | d(DS1) | b(DS1) | c(DS1) |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;06jun2022 | d(DS1) | b(DS1) | c(DS1) |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;07jun2022 | d(DS1) | b(ds3) | c(DS1) | f(ds3) | h(ds3) | i(ds3) | j(ds3) |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;08jun2022 | d(DS1) | b(ds3) | c(ds3) | i(ds3) | j(ds3) | k(ds3) | l(ds3) |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;09jun2022 | d(DS1) | i(ds3) | k(ds3) | l(ds3) | m(ds3) | n(ds3) | o(ds3) |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;10jun2022 | d(DS1) | k(ds3) | l(ds3) | m(ds3) | n(ds3) | o(ds3) | p(ds3) |&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Tks&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 22:34:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-fill-the-variables-with-data-from-2-datasets-more-a/m-p/815974#M322046</guid>
      <dc:creator>RobertHB</dc:creator>
      <dc:date>2022-05-31T22:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I fill the variables with data from 2 datasets more a list loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-fill-the-variables-with-data-from-2-datasets-more-a/m-p/815984#M322047</link>
      <description>&lt;P&gt;I don't understand what you are trying to do.&amp;nbsp; What is the actual business problem that it trying to be solved by this?&lt;/P&gt;
&lt;P&gt;Why are there ID numbers in two different datasets?&lt;/P&gt;
&lt;P&gt;What is the difference between the ID numbers in the first dataset (can you give this dataset more meaningful names? that might help explain what role they are serving) and the ID numbers in the third dataset.&lt;/P&gt;
&lt;P&gt;What is the role of the dates?&amp;nbsp; Why are there DATE variables in two of the input datasets?&amp;nbsp; What is the relationship between the input dates and the output dates?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 03:40:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-fill-the-variables-with-data-from-2-datasets-more-a/m-p/815984#M322047</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-01T03:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I fill the variables with data from 2 datasets more a list loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-fill-the-variables-with-data-from-2-datasets-more-a/m-p/816011#M322060</link>
      <description>Maybe you should try a join then use Proc Transpose.</description>
      <pubDate>Wed, 01 Jun 2022 09:20:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-fill-the-variables-with-data-from-2-datasets-more-a/m-p/816011#M322060</guid>
      <dc:creator>DartRodrigo</dc:creator>
      <dc:date>2022-06-01T09:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I fill the variables with data from 2 datasets more a list loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-fill-the-variables-with-data-from-2-datasets-more-a/m-p/816015#M322061</link>
      <description>Hello, tks for ur reply.&lt;BR /&gt;&lt;BR /&gt;The business problem is: out of office schedule. I cant't have more than 7 employees off frim the office in one day.&lt;BR /&gt;&lt;BR /&gt;Ids=employee id&lt;BR /&gt;&lt;BR /&gt;Dataset01 is a vacation dataset, with the employee id, beginning and end period.&lt;BR /&gt;&lt;BR /&gt;Dataset02 is the holiday and weekend list.&lt;BR /&gt;&lt;BR /&gt;Dataset03 is the list of all employees with the number of home-office days (according their work contract). It's a looping list.&lt;BR /&gt;&lt;BR /&gt;Tks.</description>
      <pubDate>Wed, 01 Jun 2022 21:18:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-fill-the-variables-with-data-from-2-datasets-more-a/m-p/816015#M322061</guid>
      <dc:creator>RobertHB</dc:creator>
      <dc:date>2022-06-01T21:18:10Z</dc:date>
    </item>
  </channel>
</rss>

