<?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 to declare a record in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608151#M176946</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/177633"&gt;@rkarr5&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your query, I edited my post. Please let me know if that is clear.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Ravi.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So it looks like I was right.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why did you create the variable VALUE if you aren't going to give it any values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Only thing I didn't include was adding an index (why would you need that?) or selecting distinct (why does your source data have duplicates)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Nov 2019 01:49:25 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-11-29T01:49:25Z</dc:date>
    <item>
      <title>How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608148#M176943</link>
      <description>&lt;P&gt;Hi Every one,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to convert my postgre sql code to SAS where I declared a record. What is the best way that I can declare a record in sas. How to implement the below functionality in sas either using Data step or proc sql. Any help is highly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my postgre sql code. It will declare a record and then iterate through each record at a time in the for loop. It uses the execute format to dynamically populate the values using all and year.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DO 
$do$
DECLARE
rec RECORD;
BEGIN
/* MAKE test1 TABLE */
		/* MAKE TABLE */
		CREATE TABLE test1 (Name varchar(15),year varchar(4),PRIMARY KEY (Name,year));
		/* POPULATE test1 WITH APPROPRIATE Name */
		INSERT INTO test1 (Name,year) SELECT b.Name, c.year FROM (SELECT * FROM test2) b, (SELECT DISTINCT year FROM test3) c;
		/* POPULATE test1 WITH 'ALL' ROWS */
		FOR rec IN SELECT DISTINCT year FROM test3 LOOP
			EXECUTE format('INSERT INTO test1 (Name,year) VALUES ($1,$2)')
				USING 'ALL', rec.year;
		END LOOP;
END
$do$;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 01:58:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608148#M176943</guid>
      <dc:creator>rkarr5</dc:creator>
      <dc:date>2019-11-29T01:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608149#M176944</link>
      <description>&lt;P&gt;What does "declare a record" even mean? Can you explain what that code is doing?&lt;/P&gt;
&lt;P&gt;Looks a lot like you are trying to do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test1;
  length Name $15 year $4 value 8 ;
  set test2 (keep=break year rename=(break=name))
      test3 (in=in3 keep=year)
  ;
  if in3 then break='ALL';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But it is not clear why you created a variable name VALUE if you didn't plan to give it any values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 01:37:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608149#M176944</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-11-29T01:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608150#M176945</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on your query, I edited my post. Please let me know if that is clear.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ravi.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 01:45:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608150#M176945</guid>
      <dc:creator>rkarr5</dc:creator>
      <dc:date>2019-11-29T01:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608151#M176946</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/177633"&gt;@rkarr5&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your query, I edited my post. Please let me know if that is clear.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Ravi.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So it looks like I was right.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why did you create the variable VALUE if you aren't going to give it any values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Only thing I didn't include was adding an index (why would you need that?) or selecting distinct (why does your source data have duplicates)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 01:49:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608151#M176946</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-11-29T01:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608152#M176947</link>
      <description>&lt;P&gt;I removed the value. I had a query with multiple loops and that value is used for the next loop. But I don't want to make it complex so I removed the value variable. Coming to the second part that you asked, there will be definitely duplicated values of years in my table. That's the reason I used the distinct. If you ask why do you have duplicate then I can't answer that as my data structure is like that which has duplicate records of year. For example a student who joined in multiple courses in the same year will have multiple records with same year.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 01:56:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608152#M176947</guid>
      <dc:creator>rkarr5</dc:creator>
      <dc:date>2019-11-29T01:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608154#M176949</link>
      <description>&lt;P&gt;Don’t do conversion line by line. Instead figure out what a specific process is doing and explain it with a data example, showing the input and output and explain the logic. This way, we can help point you to the best SAS solution. By groups may make the the need for loops unnecessary for starters.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/177633"&gt;@rkarr5&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I removed the value. I had a query with multiple loops and that value is used for the next loop. But I don't want to make it complex so I removed the value variable. Coming to the second part that you asked, there will be definitely duplicated values of years in my table. That's the reason I used the distinct. If you ask why do you have duplicate then I can't answer that as my data structure is like that which has duplicate records of year. For example a student who joined in multiple courses in the same year will have multiple records with same year.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 02:10:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608154#M176949</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-29T02:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608155#M176950</link>
      <description>&lt;P&gt;What is the purpose of TEST3?&amp;nbsp; Wouldn't it make more sense to get the list of ALL years from test2?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select distinct break as name,year from test2
union
select distinct "ALL" as name,year from test2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Nov 2019 02:10:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608155#M176950</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-11-29T02:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608325#M177023</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;StudentIdNo	Region	Age	agebrk	region_desc	subregion_desc	demo_age	gender	race	year
1	1A	12	12 to 17	Central	Chicago	age12to17	male	white_rac	2013
2	1B	14	12 to 17	Northern	Aurora	age12to17	female	white_rac	2014
3	1C	7	6 to 11	Southern	Dallas	age6to11	male	hispanic	2015
4	1D	3	Under 3	Central	Chicago	age0to2	female	white_rac	2016
5	1D	5	3 to 5	Northern	Aurora	age3to5	female	white_rac	2017&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So this is my data. The code&amp;nbsp; I pasted is trying to break this data into different segments based on age,gender, race,year.&amp;nbsp; So there will be a different combinations for different variables. The last for loop is trying to create a ALL value with different years. So the last for loop should append ALL and 2012, ALL,2013,ALL,2014....so on....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 19:42:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608325#M177023</guid>
      <dc:creator>rkarr5</dc:creator>
      <dc:date>2019-11-29T19:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608326#M177024</link>
      <description>&lt;P&gt;Hey Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue here is data step will update the value to All when ever it encounters the test3 dataset, But my requirement is after it gets all the data from both the datasets, it should append all value and the year for distinct years in test3 dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 19:45:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608326#M177024</guid>
      <dc:creator>rkarr5</dc:creator>
      <dc:date>2019-11-29T19:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608327#M177025</link>
      <description>So you need this to dynamically filter the data set?&lt;BR /&gt;Or are you trying to summarize/count it?&lt;BR /&gt;&lt;BR /&gt;In SAS this would be good to switch to a macro or PROC MEANS which can do multilevel summaries if that's what you want.</description>
      <pubDate>Fri, 29 Nov 2019 19:53:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608327#M177025</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-29T19:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608328#M177026</link>
      <description>&lt;P&gt;I want to dynamically filter the dataset.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 19:54:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608328#M177026</guid>
      <dc:creator>rkarr5</dc:creator>
      <dc:date>2019-11-29T19:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608331#M177027</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you likely want a macro, here are some resources on macros.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you show what fields you want to control and how you want to pass the values it becomes very easy in SAS to do this, IMO. You switch your 'records' to macro variables basically and convert the filter to a SAS process.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UCLA introductory tutorial on macro variables and macros&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Tutorial on converting a working program to a macro&lt;BR /&gt;&lt;BR /&gt;This method is pretty robust and helps prevent errors and makes it much easier to debug your code. Obviously biased, because I wrote it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Examples of common macro usage&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 19:57:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608331#M177027</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-29T19:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608333#M177029</link>
      <description>&lt;P&gt;will look into that. Can you also let me know how to start converting the above code to macros. That would be very helpful.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 20:01:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608333#M177029</guid>
      <dc:creator>rkarr5</dc:creator>
      <dc:date>2019-11-29T20:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608339#M177032</link>
      <description>The links above have everything you need. What's your SAS coding level? A filter is a very simple procedure. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://video.sas.com/detail/video/4573016761001/filtering-a-sas-table-in-a-data-step?autoStart=true&amp;amp;page=1&amp;amp;q=filter" target="_blank"&gt;https://video.sas.com/detail/video/4573016761001/filtering-a-sas-table-in-a-data-step?autoStart=true&amp;amp;page=1&amp;amp;q=filter&lt;/A&gt;</description>
      <pubDate>Fri, 29 Nov 2019 20:11:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608339#M177032</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-29T20:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608343#M177033</link>
      <description>&lt;P&gt;Thanks for the video. I am a base programmer. But here my requirement is I need to create a table with two columns Name and year which gets it value from two different tables. I used proc sql to create the table with two variables and then inserted the data using insert into table_name(value,year) select b.value,c.year from(select * from test2)b,(select distinct year from test3)c. So that query is creating a table and inserting values into the value. Then I created another table which has distinct values of year and then set it to new dataset in data step and then assigned value to 'ALL' for all the distinct years. This serves my purpose but I want to know if there is any other alternative that will do it in single go.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 20:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608343#M177033</guid>
      <dc:creator>rkarr5</dc:creator>
      <dc:date>2019-11-29T20:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608344#M177034</link>
      <description>Unless you post what I initially request, sample input, example output and the logic we can't help you refactor your code. &lt;BR /&gt;Vague descriptions, get vague answers unfortunately.</description>
      <pubDate>Fri, 29 Nov 2019 20:20:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608344#M177034</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-29T20:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608345#M177035</link>
      <description>&lt;P&gt;Seems trivial to do in SAS.&amp;nbsp; First lets convert your posted listing into an actual dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  infile datalines dsd dlm='|' truncover;
  input StudentIdNo $ 
        Region $ 
        Age 
        agebrk :$10.
        region_desc :$20. 
        subregion_desc :$20.
        demo_age :$10. 
        gender :$7. 
        race :$20. 
        year 
  ;
datalines;
1|1A|12|12 to 17|Central|Chicago|age12to17|male|white_rac|2013
2|1B|14|12 to 17|Northern|Aurora|age12to17|female|white_rac|2014
3|1C|7|6 to 11|Southern|Dallas|age6to11|male|hispanic|2015
4|1D|3|Under 3|Central|Chicago|age0to2|female|white_rac|2016
5|1D|5|3 to 5|Northern|Aurora|age3to5|female|white_rac|2017
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then to get the break down by region and year just use PROC SUMMARY.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have ;
  class region year ;
  output out=want;
run;

proc print data=want;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs    Region    year    _TYPE_    _FREQ_

  1                 .       0         5
  2              2013       1         1
  3              2014       1         1
  4              2015       1         1
  5              2016       1         1
  6              2017       1         1
  7      1A         .       2         1
  8      1B         .       2         1
  9      1C         .       2         1
 10      1D         .       2         2
 11      1A      2013       3         1
 12      1B      2014       3         1
 13      1C      2015       3         1
 14      1D      2016       3         1
 15      1D      2017       3         1
&lt;/PRE&gt;
&lt;P&gt;Look at the documentation of PROC SUMMARY (also known as PROC MEANS) to what else it can do for you.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 20:20:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608345#M177035</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-11-29T20:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608356#M177036</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/177633"&gt;@rkarr5&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hey Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue here is data step will update the value to All when ever it encounters the test3 dataset, But my requirement is after it gets all the data from both the datasets, it should append all value and the year for distinct years in test3 dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not sure why you would need to use "record" pointers to do that in your existing database. Doesn't it support normal basic SQL code?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;create table want as 
  select distinct x,y from source1
;
insert into want 
  select distinc 'ALL' as X, Y from source2
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I still think that it looks like your overall goal is to summarize data and PROC SUMMARY is a great tool to do that.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 20:42:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608356#M177036</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-11-29T20:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare a record in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608358#M177037</link>
      <description>&lt;P&gt;Thanks Tom. Will check this code. I will try to explore proc summary also.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 20:49:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-declare-a-record-in-SAS/m-p/608358#M177037</guid>
      <dc:creator>rkarr5</dc:creator>
      <dc:date>2019-11-29T20:49:08Z</dc:date>
    </item>
  </channel>
</rss>

