<?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: Query on auto generation of variable and data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Query-on-auto-generation-of-variable-and-data/m-p/696797#M212900</link>
    <description>&lt;P&gt;Check the next code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let rows = 100;
/* pfx stands for prefix */
%let pxfName = name;
/* numeric values can be computed randomly in a given range 
   using any randomizing function - like ranuni */
   data want;  
     length name $20;  
	 do i=1 to &amp;amp;rows;     
	    name ="&amp;amp;name" || put(i,5.);     
		age = int(ranuni(-1) * 100) + 8;  /* any age 8 and above up to 108 */   
		if mod(_N_,2) &amp;lt; 1 then sex = 'M'; else sex ='F';
        /* add any algorithm to compute roll randomly */		
		OUTPUT;  
     end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 05 Nov 2020 10:32:15 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2020-11-05T10:32:15Z</dc:date>
    <item>
      <title>Query on auto generation of variable and data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Query-on-auto-generation-of-variable-and-data/m-p/696795#M212898</link>
      <description>&lt;P&gt;I want to generate&amp;nbsp; a list with 4 variable like - name,age,sex,roll&amp;nbsp; and want to populate data .&lt;/P&gt;
&lt;P&gt;But for doing that I cant use any raw data file. I have to use some auto generating functions here I guess.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The variable will be generated automatically and data will be populated automatically. I can only define starting value for each variable and the number of observation I want.&lt;/P&gt;
&lt;P&gt;Kindly help me with such query.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 07:56:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Query-on-auto-generation-of-variable-and-data/m-p/696795#M212898</guid>
      <dc:creator>Lidia1</dc:creator>
      <dc:date>2020-11-05T07:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Query on auto generation of variable and data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Query-on-auto-generation-of-variable-and-data/m-p/696797#M212900</link>
      <description>&lt;P&gt;Check the next code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let rows = 100;
/* pfx stands for prefix */
%let pxfName = name;
/* numeric values can be computed randomly in a given range 
   using any randomizing function - like ranuni */
   data want;  
     length name $20;  
	 do i=1 to &amp;amp;rows;     
	    name ="&amp;amp;name" || put(i,5.);     
		age = int(ranuni(-1) * 100) + 8;  /* any age 8 and above up to 108 */   
		if mod(_N_,2) &amp;lt; 1 then sex = 'M'; else sex ='F';
        /* add any algorithm to compute roll randomly */		
		OUTPUT;  
     end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Nov 2020 10:32:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Query-on-auto-generation-of-variable-and-data/m-p/696797#M212900</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-11-05T10:32:15Z</dc:date>
    </item>
  </channel>
</rss>

