<?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: Problem in using single trailing method with do loop in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Problem-in-using-single-trailing-method-with-do-loop/m-p/582006#M7854</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/283659"&gt;@u39734216&lt;/a&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/283659"&gt;@u39734216&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Can I use a single trailing method with do loop in this.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I like your thinking&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

data want;
infile cards truncover;	/*replace the infile with appropriate path*/
input id $ bill : dollar10.2 @;
do month=1 by 1 while(month&amp;lt;countw(_infile_,' '));
 output;
 input bill : dollar10.2 @;
end;
format bill dollar10.2;
cards;
108263 $946.00 $903.00 $804.00 $674.00 $663.00 $195.00 $922.00 $595.00 $157.00 $415.00 $868.00 $750.00
103681 $135.00 $573.00 $642.00 $208.00 $922.00 $592.00 $425.00 $658.00 $131.00 $648.00 $750.00 $515.00
116865 $624.00 $679.00 $402.00 $636.00 $358.00 $560.00 $884.00 $514.00 $565.00 $278.00 $117.00 $852.00
102998 $747.00 $505.00 $549.00 $942.00 $884.00 $991.00 $480.00 $326.00 $447.00 $617.00 $721.00 $874.00
115569 $254.00 $792.00 $420.00 $642.00 $851.00 $258.00 $872.00 $828.00 $658.00 $260.00 $499.00 $575.00
120252 $499.00 $514.00 $141.00 $870.00 $968.00 $191.00 $943.00 $788.00 $286.00 $213.00 $944.00 $752.00
102563 $167.00 $125.00 $976.00 $483.00 $517.00 $797.00 $879.00 $988.00 $910.00 $451.00 $468.00 $236.00
104280 $443.00 $785.00 $758.00 $911.00 $940.00 $276.00 $428.00 $706.00 $277.00 $936.00 $675.00 $268.00
114883 $983.00 $371.00 $483.00 $960.00 $890.00 $974.00 $619.00 $499.00 $219.00 $629.00 $918.00 $588.00
109022 $440.00 $739.00 $703.00 $729.00 $915.00 $634.00 $373.00 $511.00 $993.00 $427.00 $715.00 $261.00
100801 $267.00 $572.00 $309.00 $344.00 $990.00 $610.00 $775.00 $674.00 $658.00 $366.00 $441.00 $746.00
117016 $834.00 $130.00 $676.00 $211.00 $992.00 $426.00 $140.00 $301.00 $562.00 $874.00 $853.00 $742.00
120727 $980.00 $966.00 $730.00 $748.00 $600.00 $833.00 $205.00 $780.00 $615.00 $792.00 $574.00 $943.00
114764 $115.00 $315.00 $755.00 $599.00 $986.00 $450.00 $741.00 $467.00 $527.00 $693.00 $674.00 $781.00
117877 $794.00 $290.00 $758.00 $854.00 $494.00 $576.00 $877.00 $198.00 $485.00 $272.00 $914.00 $735.00
102649 $585.00 $659.00 $795.00 $789.00 $807.00 $983.00 $369.00 $323.00 $614.00 $155.00 $367.00 $274.00
119729 $855.00 $487.00 $657.00 $668.00 $683.00 $868.00 $143.00 $148.00 $648.00 $454.00 $219.00 $140.00
116952 $621.00 $750.00 $844.00 $296.00 $199.00 $959.00 $519.00 $266.00 $809.00 $908.00 $641.00 $588.00
118038 $515.00 $256.00 $169.00 $928.00 $203.00 $460.00 $609.00 $474.00 $665.00 $465.00 $865.00 $354.00
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;
&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 19:31:22 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2019-08-18T19:31:22Z</dc:date>
    <item>
      <title>Problem in using single trailing method with do loop</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-in-using-single-trailing-method-with-do-loop/m-p/581996#M7849</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;“Client_ID_12_months_bill.txt” contains the 12 months credit card bill against each client_id in a single record. Import the data into SAS such that bill for each month is recorded as a separate observation and month number is also specified the data. guys can you help me. I don't know how to do it. I want the output in three columns client id months and bill.&amp;nbsp; pls, help me.&lt;/P&gt;&lt;P&gt;The data is like -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;108263 $946.00 $903.00 $804.00 $674.00 $663.00 $195.00 $922.00 $595.00 $157.00 $415.00 $868.00 $750.00&lt;BR /&gt;103681 $135.00 $573.00 $642.00 $208.00 $922.00 $592.00 $425.00 $658.00 $131.00 $648.00 $750.00 $515.00&lt;BR /&gt;116865 $624.00 $679.00 $402.00 $636.00 $358.00 $560.00 $884.00 $514.00 $565.00 $278.00 $117.00 $852.00&lt;BR /&gt;102998 $747.00 $505.00 $549.00 $942.00 $884.00 $991.00 $480.00 $326.00 $447.00 $617.00 $721.00 $874.00&lt;BR /&gt;115569 $254.00 $792.00 $420.00 $642.00 $851.00 $258.00 $872.00 $828.00 $658.00 $260.00 $499.00 $575.00&lt;BR /&gt;120252 $499.00 $514.00 $141.00 $870.00 $968.00 $191.00 $943.00 $788.00 $286.00 $213.00 $944.00 $752.00&lt;BR /&gt;102563 $167.00 $125.00 $976.00 $483.00 $517.00 $797.00 $879.00 $988.00 $910.00 $451.00 $468.00 $236.00&lt;BR /&gt;104280 $443.00 $785.00 $758.00 $911.00 $940.00 $276.00 $428.00 $706.00 $277.00 $936.00 $675.00 $268.00&lt;BR /&gt;114883 $983.00 $371.00 $483.00 $960.00 $890.00 $974.00 $619.00 $499.00 $219.00 $629.00 $918.00 $588.00&lt;BR /&gt;109022 $440.00 $739.00 $703.00 $729.00 $915.00 $634.00 $373.00 $511.00 $993.00 $427.00 $715.00 $261.00&lt;BR /&gt;100801 $267.00 $572.00 $309.00 $344.00 $990.00 $610.00 $775.00 $674.00 $658.00 $366.00 $441.00 $746.00&lt;BR /&gt;117016 $834.00 $130.00 $676.00 $211.00 $992.00 $426.00 $140.00 $301.00 $562.00 $874.00 $853.00 $742.00&lt;BR /&gt;120727 $980.00 $966.00 $730.00 $748.00 $600.00 $833.00 $205.00 $780.00 $615.00 $792.00 $574.00 $943.00&lt;BR /&gt;114764 $115.00 $315.00 $755.00 $599.00 $986.00 $450.00 $741.00 $467.00 $527.00 $693.00 $674.00 $781.00&lt;BR /&gt;117877 $794.00 $290.00 $758.00 $854.00 $494.00 $576.00 $877.00 $198.00 $485.00 $272.00 $914.00 $735.00&lt;BR /&gt;102649 $585.00 $659.00 $795.00 $789.00 $807.00 $983.00 $369.00 $323.00 $614.00 $155.00 $367.00 $274.00&lt;BR /&gt;119729 $855.00 $487.00 $657.00 $668.00 $683.00 $868.00 $143.00 $148.00 $648.00 $454.00 $219.00 $140.00&lt;BR /&gt;116952 $621.00 $750.00 $844.00 $296.00 $199.00 $959.00 $519.00 $266.00 $809.00 $908.00 $641.00 $588.00&lt;BR /&gt;118038 $515.00 $256.00 $169.00 $928.00 $203.00 $460.00 $609.00 $474.00 $665.00 $465.00 $865.00 $354.00&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 07:29:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-in-using-single-trailing-method-with-do-loop/m-p/581996#M7849</guid>
      <dc:creator>u39734216</dc:creator>
      <dc:date>2019-08-18T07:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in using single trailing method with do loop</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-in-using-single-trailing-method-with-do-loop/m-p/581997#M7850</link>
      <description>&lt;P&gt;Insert path and filename &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(keep=clientid month bill);
	infile "YourPathHere\file.txt";
	input clientid (month1-month12)(:comma8.2);
	array _{*} month:;
	do month=1 to dim(_);
		bill=_[month];
		output;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Aug 2019 07:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-in-using-single-trailing-method-with-do-loop/m-p/581997#M7850</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-08-18T07:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in using single trailing method with do loop</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-in-using-single-trailing-method-with-do-loop/m-p/581998#M7851</link>
      <description>&lt;P&gt;can you pls explain why did you use underscore and what does dim means? By the way thanks for the answer.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 07:58:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-in-using-single-trailing-method-with-do-loop/m-p/581998#M7851</guid>
      <dc:creator>u39734216</dc:creator>
      <dc:date>2019-08-18T07:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in using single trailing method with do loop</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-in-using-single-trailing-method-with-do-loop/m-p/581999#M7852</link>
      <description>&lt;P&gt;The underscore is just the name of the array. Could be any valid SAS name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Dim Function returns the dimension of the array, in this case 12.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anytime, glad to help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 08:00:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-in-using-single-trailing-method-with-do-loop/m-p/581999#M7852</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-08-18T08:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in using single trailing method with do loop</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-in-using-single-trailing-method-with-do-loop/m-p/582000#M7853</link>
      <description>&lt;P&gt;Can I use a single trailing method with do loop in this.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 10:26:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-in-using-single-trailing-method-with-do-loop/m-p/582000#M7853</guid>
      <dc:creator>u39734216</dc:creator>
      <dc:date>2019-08-18T10:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in using single trailing method with do loop</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-in-using-single-trailing-method-with-do-loop/m-p/582006#M7854</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/283659"&gt;@u39734216&lt;/a&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/283659"&gt;@u39734216&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Can I use a single trailing method with do loop in this.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I like your thinking&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

data want;
infile cards truncover;	/*replace the infile with appropriate path*/
input id $ bill : dollar10.2 @;
do month=1 by 1 while(month&amp;lt;countw(_infile_,' '));
 output;
 input bill : dollar10.2 @;
end;
format bill dollar10.2;
cards;
108263 $946.00 $903.00 $804.00 $674.00 $663.00 $195.00 $922.00 $595.00 $157.00 $415.00 $868.00 $750.00
103681 $135.00 $573.00 $642.00 $208.00 $922.00 $592.00 $425.00 $658.00 $131.00 $648.00 $750.00 $515.00
116865 $624.00 $679.00 $402.00 $636.00 $358.00 $560.00 $884.00 $514.00 $565.00 $278.00 $117.00 $852.00
102998 $747.00 $505.00 $549.00 $942.00 $884.00 $991.00 $480.00 $326.00 $447.00 $617.00 $721.00 $874.00
115569 $254.00 $792.00 $420.00 $642.00 $851.00 $258.00 $872.00 $828.00 $658.00 $260.00 $499.00 $575.00
120252 $499.00 $514.00 $141.00 $870.00 $968.00 $191.00 $943.00 $788.00 $286.00 $213.00 $944.00 $752.00
102563 $167.00 $125.00 $976.00 $483.00 $517.00 $797.00 $879.00 $988.00 $910.00 $451.00 $468.00 $236.00
104280 $443.00 $785.00 $758.00 $911.00 $940.00 $276.00 $428.00 $706.00 $277.00 $936.00 $675.00 $268.00
114883 $983.00 $371.00 $483.00 $960.00 $890.00 $974.00 $619.00 $499.00 $219.00 $629.00 $918.00 $588.00
109022 $440.00 $739.00 $703.00 $729.00 $915.00 $634.00 $373.00 $511.00 $993.00 $427.00 $715.00 $261.00
100801 $267.00 $572.00 $309.00 $344.00 $990.00 $610.00 $775.00 $674.00 $658.00 $366.00 $441.00 $746.00
117016 $834.00 $130.00 $676.00 $211.00 $992.00 $426.00 $140.00 $301.00 $562.00 $874.00 $853.00 $742.00
120727 $980.00 $966.00 $730.00 $748.00 $600.00 $833.00 $205.00 $780.00 $615.00 $792.00 $574.00 $943.00
114764 $115.00 $315.00 $755.00 $599.00 $986.00 $450.00 $741.00 $467.00 $527.00 $693.00 $674.00 $781.00
117877 $794.00 $290.00 $758.00 $854.00 $494.00 $576.00 $877.00 $198.00 $485.00 $272.00 $914.00 $735.00
102649 $585.00 $659.00 $795.00 $789.00 $807.00 $983.00 $369.00 $323.00 $614.00 $155.00 $367.00 $274.00
119729 $855.00 $487.00 $657.00 $668.00 $683.00 $868.00 $143.00 $148.00 $648.00 $454.00 $219.00 $140.00
116952 $621.00 $750.00 $844.00 $296.00 $199.00 $959.00 $519.00 $266.00 $809.00 $908.00 $641.00 $588.00
118038 $515.00 $256.00 $169.00 $928.00 $203.00 $460.00 $609.00 $474.00 $665.00 $465.00 $865.00 $354.00
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;
&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 19:31:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-in-using-single-trailing-method-with-do-loop/m-p/582006#M7854</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-18T19:31:22Z</dc:date>
    </item>
  </channel>
</rss>

