<?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: &amp;quot;Back-filling&amp;quot; arrays in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/quot-Back-filling-quot-arrays/m-p/141734#M296665</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate the feedback and solution. Below is my code so far after my transposition; I am having problems with the do-loop in my last datastep, however. My goal is to retain the values in the COL1 variable and set to blank all other observations (except those in the 'in' statement) in the COL2 to COL10 variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please take a look?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data WORK.NCDebt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile '/FilePath/NCDebt.csv' dsd lrecl=40000 firstobs=3 obs=3;&lt;BR /&gt;informat InstrumentName $15.;&lt;BR /&gt;informat PriceToPublic 10.8;&lt;BR /&gt;informat Cusip $15.;&lt;BR /&gt;informat CouponDates mmddyy10.;&lt;BR /&gt;informat ValuationDate yymmdd.;&lt;BR /&gt;informat AccruedDayCount $10.;&lt;BR /&gt;informat FullPrice 10.8;&lt;BR /&gt;informat InterestFrequency 5.;&lt;BR /&gt;informat Notional 12.;&lt;BR /&gt;informat MaturityDate mmddyy10.;&lt;BR /&gt;informat ID $10.;&lt;BR /&gt;informat FaceValues 8.;&lt;BR /&gt;informat PaymentDayCount $10.;&lt;BR /&gt;informat FlatPrice 10.8;&lt;BR /&gt;informat Description $30.;&lt;BR /&gt;informat Comments $30.;&lt;BR /&gt;informat MarketCleanPrice 10.8;&lt;BR /&gt;informat SettlementDate yymmdd.;&lt;BR /&gt;informat Name $20.;&lt;BR /&gt;informat Category $40.;&lt;BR /&gt;informat PaymentDates mmddyy10.;&lt;BR /&gt;informat AnnualCouponRates 6.4;&lt;BR /&gt;informat OriginationDate mmddyy10.;&lt;BR /&gt;informat OAS 5.2;&lt;BR /&gt;informat FirstCpnDt mmddyy10.;&lt;BR /&gt;format PriceToPublic 10.8;&lt;BR /&gt;format FullPrice 10.8;&lt;BR /&gt;format CouponDates MaturityDate ValuationDate PaymentDates OriginationDate &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SettlementDate FirstCpnDt date9.;&lt;BR /&gt;input InstrumentName $ PriceToPublic Cusip $ CouponDates ValuationDate&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AccruedDayCount $ FullPrice InterestFrequency Notional MaturityDate &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID $ FaceValues PaymentDayCount $ FlatPrice Description $ Comments $ &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MarketCleanPrice&amp;nbsp; &amp;amp;intSettlementDate Name $ Category $ PaymentDates&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AnnualCouponRates OriginationDate OAS FirstCpnDt;&lt;BR /&gt;ID=Cusip;&lt;BR /&gt;Name=Cusip;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data NCDebt2;&lt;BR /&gt;&amp;nbsp; retain InstrumentName PriceToPublic Cusip CouponDates ValuationDate&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AccruedDayCount DiscountSource FullPrice UnderWriterDelivery &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InterestFrequency Notional MaturityDate ID FaceValues &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PaymentDayCount CouponAdjusting FlatPrice Description Comments&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MarketCleanPrice BusinessDayAdjust CouponEntry SettlementDate Name Category&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PaymentDates AnnualCouponRates UnderwriterDiscount DisableLegacyMeasures &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OriginationDate OAS FirstCpnDt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DiscountSource='OIS';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UnderWriterDelivery=-1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CouponAdjusting='false';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BusinessDayAdjust='Following';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CouponEntry='Manual';&lt;BR /&gt;&amp;nbsp; UnderwriterDiscount=0.0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DisableLegacyMeasures='false';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format UnderwriterDiscount 3.1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set NCDebt;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data NCDebt3;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set NCDebt2;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if InterestFrequency=2&amp;nbsp; then interval='semiyear';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if InterestFrequency=12 then interval='month&amp;nbsp;&amp;nbsp; ';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; intervals= intck(interval,FirstCpnDt,MaturityDate);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; do i=1 to intervals;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CouponDates=intnx(interval,MaturityDate,i-intervals,'same');&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PaymentDates=CouponDates;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format CouponDates PaymentDates date9.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %let FirstCpnDt=FirstCpnDt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %let intervals=intervals;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;FirstCpnDt &amp;amp;intervals;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc transpose data=NCDebt3 out=NCDebt4(rename=(_name_=var1)) ;&lt;BR /&gt; var InstrumentName PriceToPublic Cusip CouponDates ValuationDate&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AccruedDayCount DiscountSource FullPrice UnderWriterDelivery&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InterestFrequency Notional MaturityDate ID FaceValues&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PaymentDayCount CouponAdjusting FlatPrice Description Comments&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MarketCleanPrice BusinessDayAdjust CouponEntry SettlementDate&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name Category PaymentDates AnnualCouponRates UnderwriterDiscount&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DisableLegacyMeasures OriginationDate OAS;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data NCDebt5;&lt;BR /&gt;&amp;nbsp; set NCDebt4;&lt;BR /&gt;&amp;nbsp; %let i=2;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if var1 not in ('CouponDates','FaceValues','PaymentDates','AnnualCouponRates') then do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=%eval(&amp;amp;i) to 10;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COL%eval(&amp;amp;i)=' ';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;i;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Sep 2014 16:41:56 GMT</pubDate>
    <dc:creator>maroulator</dc:creator>
    <dc:date>2014-09-12T16:41:56Z</dc:date>
    <item>
      <title>"Back-filling" arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Back-filling-quot-arrays/m-p/141731#M296662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been working with the following code which is applied to the attached NCDebt.csv dataset; I am only loading one record into SAS. The code does exactly what I need it to do up until the macro definition; the macro definition represents my initial (incomplete) attempt at what it is that I am trying to achieve. What I am trying to achieve is to make the array in the NCDebt3 dataset look exactly like the one in the attached "Desired Array.csv" file. &lt;STRONG&gt;Because of the specifications of my business problem&lt;/STRONG&gt;, &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;I need to "back-fill" the array in NCDebt3&lt;/EM&gt;&lt;/SPAN&gt;; this means that in order for me to get the array that I want (again see attached "Desired Array.csv" file), I need to start with the value in date60 and work my way down to date1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any insight would be extremely appreciated. Many thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data WORK.NCDebt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile '/FilePath/NCDebt.csv' dsd lrecl=40000 firstobs=3 obs=3;&lt;BR /&gt;informat InstrumentName $15.;&lt;BR /&gt;informat PriceToPublic 10.8;&lt;BR /&gt;informat Cusip $15.;&lt;BR /&gt;informat CouponDates mmddyy10.;&lt;BR /&gt;informat ValuationDate yymmdd.;&lt;BR /&gt;informat AccruedDayCount $10.;&lt;BR /&gt;informat FullPrice 10.8;&lt;BR /&gt;informat InterestFrequency 5.;&lt;BR /&gt;informat Notional 12.;&lt;BR /&gt;informat MaturityDate mmddyy10.;&lt;BR /&gt;informat ID $10.;&lt;BR /&gt;informat FaceValues 8.;&lt;BR /&gt;informat PaymentDayCount $10.;&lt;BR /&gt;informat FlatPrice 10.8;&lt;BR /&gt;informat Description $30.;&lt;BR /&gt;informat Comments $30.;&lt;BR /&gt;informat MarketCleanPrice 10.8;&lt;BR /&gt;informat SettlementDate yymmdd.;&lt;BR /&gt;informat Name $20.;&lt;BR /&gt;informat Category $40.;&lt;BR /&gt;informat PaymentDates mmddyy10.;&lt;BR /&gt;informat AnnualCouponRates 6.4;&lt;BR /&gt;informat OriginationDate mmddyy10.;&lt;BR /&gt;informat OAS 5.2;&lt;BR /&gt;informat FirstCpnDt mmddyy10.;&lt;BR /&gt;format PriceToPublic 10.8;&lt;BR /&gt;format FullPrice 10.8;&lt;BR /&gt;format CouponDates MaturityDate ValuationDate PaymentDates OriginationDate &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SettlementDate FirstCpnDt date9.;&lt;BR /&gt;input InstrumentName $ PriceToPublic Cusip $ CouponDates ValuationDate&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AccruedDayCount $ FullPrice InterestFrequency Notional MaturityDate &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID $ FaceValues PaymentDayCount $ FlatPrice Description $ Comments $ &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MarketCleanPrice SettlementDate Name $ Category $ PaymentDates&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AnnualCouponRates OriginationDate OAS FirstCpnDt;&lt;BR /&gt;ID=Cusip;&lt;BR /&gt;Name=Cusip;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data NCDebt2;&lt;BR /&gt;&amp;nbsp; retain InstrumentName PriceToPublic Cusip CouponDates ValuationDate&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AccruedDayCount DiscountSource FullPrice UnderWriterDelivery &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InterestFrequency Notional MaturityDate ID FaceValues &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PaymentDayCount CouponAdjusting FlatPrice Description Comments&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MarketCleanPrice BusinessDayAdjust CouponEntry SettlementDate Name Category&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PaymentDates AnnualCouponRates UnderwriterDiscount DisableLegacyMeasures &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OriginationDate OAS FirstCpnDt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DiscountSource='OIS';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UnderWriterDelivery=-1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CouponAdjusting='false';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BusinessDayAdjust='Following';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CouponEntry='Manual';&lt;BR /&gt;&amp;nbsp; UnderwriterDiscount=0.0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DisableLegacyMeasures='false';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format UnderwriterDiscount 3.1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set NCDebt;&lt;BR /&gt;&amp;nbsp; Result= MaturityDate-ValuationDate;&lt;BR /&gt;&amp;nbsp; if InterestFrequency=2 then do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arrelements=(intck('semiyear',FirstCpnDt,MaturityDate)+1);&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; else if InterestFrequency=12 then do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arrelements=(intck('month',FirstCpnDt,MaturityDate)+1);&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; call symput('arrelements',arrelements);&lt;BR /&gt;&amp;nbsp; drop Result arrelements;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;arrelements;&lt;/P&gt;&lt;P&gt;data NCDebt3;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set NCDebt2;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; array date{&amp;amp;arrelements} date1-date%eval(&amp;amp;arrelements);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; date%eval(&amp;amp;arrelements)=MaturityDate;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; date1=FirstCpnDt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; format date1 date%eval(&amp;amp;arrelements) date9.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%macro Cashflows();&lt;/P&gt;&lt;P&gt;data NCDebt4;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set NCDebt3;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %do k=0 %to 2; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do i=1 %to 3; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if month(date%eval(&amp;amp;arrelements))&amp;gt;6 then do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let month=%sysfunc(month(date%eval(&amp;amp;arrelements-&amp;amp;i)))-6;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let year=%sysfunc(year(date%eval(&amp;amp;arrelements-&amp;amp;k)));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;month &amp;amp;year;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if month(date%eval(&amp;amp;arrelements))&amp;lt;6 then do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let month=%sysfunc(month(date%eval(&amp;amp;arrelements)))+6;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let year=%sysfunc(year(date%eval(&amp;amp;arrelements-&amp;amp;i)))-1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;month &amp;amp;year;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %end; &lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend Cashflows;&lt;/P&gt;&lt;P&gt;%Cashflows;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 23:26:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Back-filling-quot-arrays/m-p/141731#M296662</guid>
      <dc:creator>maroulator</dc:creator>
      <dc:date>2014-09-11T23:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: "Back-filling" arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Back-filling-quot-arrays/m-p/141732#M296663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've seen several questions from you on this same topic and haven't responded. Looking at it though, I really think there's a better way to solve your programming problem than the method you're using.&amp;nbsp; &lt;/P&gt;&lt;P&gt;For one, SAS has several financial functions that may be useful, as well as the fact that going down rows rather than across an array may be an easier method.&amp;nbsp; Then you can transpose at the end to get your desired format. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 00:07:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Back-filling-quot-arrays/m-p/141732#M296663</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-09-12T00:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: "Back-filling" arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Back-filling-quot-arrays/m-p/141733#M296664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you have finally posted something this is close to a description of your actual problem.&lt;/P&gt;&lt;P&gt;You have a first date and a last date and you want to generate all of the dates in between.&amp;nbsp; The interval to use for the dates can either be monthly or semi-annually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First thing you should do is forget that SAS has&amp;nbsp; macro processing features and just solve your programming task using data steps and procs.&lt;/P&gt;&lt;P&gt;Second is reduce the problem&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt; t&lt;/SPAN&gt;o the part you need to solve. In this case we don't care how you are reading in your original data to find the two dates and the interval.&amp;nbsp; So we can just start with a simple data step to create an example data record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background-color: white;"&gt; have ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background-color: white;"&gt;&amp;nbsp; FirstCpnDt=&lt;/SPAN&gt;&lt;SPAN style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;'31MAR2011'd&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background-color: white;"&gt;&amp;nbsp; InterestFrequency=&lt;/SPAN&gt;&lt;SPAN style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background-color: white;"&gt;&amp;nbsp; MaturityDate=&lt;/SPAN&gt;&lt;SPAN style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;'15MAY2041'd&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: blue; background-color: white;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background-color: white;"&gt; FirstCpnDt MaturityDate &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: teal; background-color: white;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="background-color: white; color: black; font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Now you want to find out how many intervals it will take to go from&amp;nbsp; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;FirstCpnDt to MaturityDate.&amp;nbsp; You can use the INTCK() function for this. (Note no macro logic is need to preform simple arithmetic or even complex date function calculations using SAS.). Then you want to generate all of the dates. So use a DO loop and generate the dates using the INTNX() function.&amp;nbsp; You DO NOT NEED to create multiple columns, just output multiple rows.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: navy; font-size: 10pt; background-color: white;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt; want ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-size: 10pt; background-color: white;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt; have ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-size: 10pt; background-color: white;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt; InterestFrequency=&lt;/SPAN&gt;&lt;SPAN style="color: teal; font-size: 10pt; background-color: white;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt; interval=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; background-color: white;"&gt;'semiyear'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-size: 10pt; background-color: white;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt; InterestFrequency=&lt;/SPAN&gt;&lt;SPAN style="color: teal; font-size: 10pt; background-color: white;"&gt;&lt;STRONG&gt;12&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt; interval=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; background-color: white;"&gt;'month&amp;nbsp;&amp;nbsp; '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="line-height: 1.5em; color: black; font-size: 10pt; background-color: white; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; intervals= intck(interval,FirstCpnDt,MaturityDate);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt; i=&lt;/SPAN&gt;&lt;SPAN style="color: teal; font-size: 10pt; background-color: white;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt; intervals;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date=intnx(interval,MaturityDate,i-intervals,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; background-color: white;"&gt;'same'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt;);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt; date &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: teal; background-color: white;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: navy; font-size: 10pt; background-color: white;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: arial, helvetica, sans-serif;"&gt;Note that this data step will work just as well for an input file with 1000 date pairs as it does for this simple example with just one observation.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background-color: white;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;If you did want to generate that strange CSV file with one row and 60 columns then you can just use PROC TRANSPOSE.&amp;nbsp; (Note that to process all of your data this way make sure to add a BY statement to PROC TRANSPOSE to include your id variables in the new horizontal dataset.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background-color: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: navy; font-size: 10pt; background-color: white;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; font-size: 10pt; background-color: white;"&gt;&lt;STRONG&gt;transpose&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt;=want &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt;=dont_want(drop=_name_) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;prefix&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt;=date ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;&amp;nbsp; id&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt; i ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;&amp;nbsp; var&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt; date;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: navy; font-size: 10pt; background-color: white;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: navy; font-size: 10pt; background-color: white;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt; dont_want ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; background-color: white;"&gt;_all_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt;) (=/);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: navy; font-size: 10pt; background-color: white;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: black; background-color: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date1=15NOV2011&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date2=15MAY2012&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date3=15NOV2012&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date4=15MAY2013&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date5=15NOV2013&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date6=15MAY2014&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date7=15NOV2014&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date8=15MAY2015&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date9=15NOV2015&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date10=15MAY2016&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date11=15NOV2016&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date12=15MAY2017&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date13=15NOV2017&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date14=15MAY2018&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date15=15NOV2018&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date16=15MAY2019&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date17=15NOV2019&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date18=15MAY2020&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date19=15NOV2020&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date20=15MAY2021&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date21=15NOV2021&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date22=15MAY2022&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date23=15NOV2022&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date24=15MAY2023&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date25=15NOV2023&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date26=15MAY2024&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date27=15NOV2024&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date28=15MAY2025&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date29=15NOV2025&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date30=15MAY2026&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date31=15NOV2026&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date32=15MAY2027&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date33=15NOV2027&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date34=15MAY2028&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date35=15NOV2028&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date36=15MAY2029&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date37=15NOV2029&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date38=15MAY2030&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date39=15NOV2030&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date40=15MAY2031&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date41=15NOV2031&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date42=15MAY2032&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date43=15NOV2032&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date44=15MAY2033&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date45=15NOV2033&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date46=15MAY2034&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date47=15NOV2034&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date48=15MAY2035&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date49=15NOV2035&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date50=15MAY2036&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date51=15NOV2036&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date52=15MAY2037&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date53=15NOV2037&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date54=15MAY2038&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date55=15NOV2038&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date56=15MAY2039&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date57=15NOV2039&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date58=15MAY2040&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date59=15NOV2040&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;date60=15MAY2041&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 02:22:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Back-filling-quot-arrays/m-p/141733#M296664</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-12T02:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: "Back-filling" arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Back-filling-quot-arrays/m-p/141734#M296665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate the feedback and solution. Below is my code so far after my transposition; I am having problems with the do-loop in my last datastep, however. My goal is to retain the values in the COL1 variable and set to blank all other observations (except those in the 'in' statement) in the COL2 to COL10 variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please take a look?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data WORK.NCDebt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile '/FilePath/NCDebt.csv' dsd lrecl=40000 firstobs=3 obs=3;&lt;BR /&gt;informat InstrumentName $15.;&lt;BR /&gt;informat PriceToPublic 10.8;&lt;BR /&gt;informat Cusip $15.;&lt;BR /&gt;informat CouponDates mmddyy10.;&lt;BR /&gt;informat ValuationDate yymmdd.;&lt;BR /&gt;informat AccruedDayCount $10.;&lt;BR /&gt;informat FullPrice 10.8;&lt;BR /&gt;informat InterestFrequency 5.;&lt;BR /&gt;informat Notional 12.;&lt;BR /&gt;informat MaturityDate mmddyy10.;&lt;BR /&gt;informat ID $10.;&lt;BR /&gt;informat FaceValues 8.;&lt;BR /&gt;informat PaymentDayCount $10.;&lt;BR /&gt;informat FlatPrice 10.8;&lt;BR /&gt;informat Description $30.;&lt;BR /&gt;informat Comments $30.;&lt;BR /&gt;informat MarketCleanPrice 10.8;&lt;BR /&gt;informat SettlementDate yymmdd.;&lt;BR /&gt;informat Name $20.;&lt;BR /&gt;informat Category $40.;&lt;BR /&gt;informat PaymentDates mmddyy10.;&lt;BR /&gt;informat AnnualCouponRates 6.4;&lt;BR /&gt;informat OriginationDate mmddyy10.;&lt;BR /&gt;informat OAS 5.2;&lt;BR /&gt;informat FirstCpnDt mmddyy10.;&lt;BR /&gt;format PriceToPublic 10.8;&lt;BR /&gt;format FullPrice 10.8;&lt;BR /&gt;format CouponDates MaturityDate ValuationDate PaymentDates OriginationDate &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SettlementDate FirstCpnDt date9.;&lt;BR /&gt;input InstrumentName $ PriceToPublic Cusip $ CouponDates ValuationDate&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AccruedDayCount $ FullPrice InterestFrequency Notional MaturityDate &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID $ FaceValues PaymentDayCount $ FlatPrice Description $ Comments $ &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MarketCleanPrice&amp;nbsp; &amp;amp;intSettlementDate Name $ Category $ PaymentDates&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AnnualCouponRates OriginationDate OAS FirstCpnDt;&lt;BR /&gt;ID=Cusip;&lt;BR /&gt;Name=Cusip;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data NCDebt2;&lt;BR /&gt;&amp;nbsp; retain InstrumentName PriceToPublic Cusip CouponDates ValuationDate&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AccruedDayCount DiscountSource FullPrice UnderWriterDelivery &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InterestFrequency Notional MaturityDate ID FaceValues &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PaymentDayCount CouponAdjusting FlatPrice Description Comments&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MarketCleanPrice BusinessDayAdjust CouponEntry SettlementDate Name Category&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PaymentDates AnnualCouponRates UnderwriterDiscount DisableLegacyMeasures &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OriginationDate OAS FirstCpnDt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DiscountSource='OIS';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UnderWriterDelivery=-1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CouponAdjusting='false';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BusinessDayAdjust='Following';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CouponEntry='Manual';&lt;BR /&gt;&amp;nbsp; UnderwriterDiscount=0.0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DisableLegacyMeasures='false';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format UnderwriterDiscount 3.1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set NCDebt;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data NCDebt3;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set NCDebt2;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if InterestFrequency=2&amp;nbsp; then interval='semiyear';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if InterestFrequency=12 then interval='month&amp;nbsp;&amp;nbsp; ';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; intervals= intck(interval,FirstCpnDt,MaturityDate);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; do i=1 to intervals;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CouponDates=intnx(interval,MaturityDate,i-intervals,'same');&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PaymentDates=CouponDates;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format CouponDates PaymentDates date9.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %let FirstCpnDt=FirstCpnDt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %let intervals=intervals;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;FirstCpnDt &amp;amp;intervals;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc transpose data=NCDebt3 out=NCDebt4(rename=(_name_=var1)) ;&lt;BR /&gt; var InstrumentName PriceToPublic Cusip CouponDates ValuationDate&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AccruedDayCount DiscountSource FullPrice UnderWriterDelivery&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InterestFrequency Notional MaturityDate ID FaceValues&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PaymentDayCount CouponAdjusting FlatPrice Description Comments&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MarketCleanPrice BusinessDayAdjust CouponEntry SettlementDate&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name Category PaymentDates AnnualCouponRates UnderwriterDiscount&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DisableLegacyMeasures OriginationDate OAS;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data NCDebt5;&lt;BR /&gt;&amp;nbsp; set NCDebt4;&lt;BR /&gt;&amp;nbsp; %let i=2;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if var1 not in ('CouponDates','FaceValues','PaymentDates','AnnualCouponRates') then do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=%eval(&amp;amp;i) to 10;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COL%eval(&amp;amp;i)=' ';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;i;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 16:41:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Back-filling-quot-arrays/m-p/141734#M296665</guid>
      <dc:creator>maroulator</dc:creator>
      <dc:date>2014-09-12T16:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: "Back-filling" arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Back-filling-quot-arrays/m-p/141735#M296666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First step is to move all pure macro statements (like %LET)&amp;nbsp; out of the middle of your SAS steps.&amp;nbsp; SAS will evaluate the macro code BEFORE it begins executing the SAS code.&amp;nbsp; Mixing them into the middle of the SAS steps is causing you to get confused.&lt;/P&gt;&lt;P&gt;For example in your third step you have two %LET statements just before the RUN statement. &lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: blue; background-color: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: blue; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background-color: white;"&gt; FirstCpnDt=FirstCpnDt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: blue; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background-color: white;"&gt; intervals=intervals;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: black; background-color: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Those should be before the DATA statement as they are not something this is going to happen while the data step is running. In fact you could put them at the top of the program since they are just setting the macro variables to constant strings.&amp;nbsp; And what value does it add to your program to set the macro variable INTERVALS to the character string intervals?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also let's look at your last data step.&amp;nbsp; Since you are setting the macro variable I to 2 in the %LET statement the SAS code you are generating is just this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; NCDebt5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; NCDebt4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Courier New'; color: blue; background-color: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Courier New'; color: black; background-color: white;"&gt; var1 not in (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Courier New'; color: purple; background-color: white;"&gt;'CouponDates'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Courier New'; color: black; background-color: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Courier New'; color: purple; background-color: white;"&gt;'FaceValues'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Courier New'; color: black; background-color: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Courier New'; color: purple; background-color: white;"&gt;'PaymentDates'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Courier New'; color: black; background-color: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Courier New'; color: purple; background-color: white;"&gt;'AnnualCouponRates'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Courier New'; color: black; background-color: white;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Courier New'; color: blue; background-color: white;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Courier New'; color: blue; background-color: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Courier New'; color: black; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; i=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;2 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;to&lt;/SPAN&gt; &lt;SPAN style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;10&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: red; background: white;"&gt;COL2&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; background-color: white; font-family: 'Courier New'; background-position: initial initial; background-repeat: initial initial;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So depending on the value of VAR1 you either do nothing to the variable COL2 or you repeatedly set it to blank.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 17:26:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Back-filling-quot-arrays/m-p/141735#M296666</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-12T17:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: "Back-filling" arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Back-filling-quot-arrays/m-p/141736#M296667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have completed my code which you can find in the discussion titled &lt;STRONG&gt;Proc Export - Issues with Exporting to .txt files&lt;/STRONG&gt;. I hope that this gives you an idea of my final product and I also hope to stay in your good graces.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Sep 2014 01:11:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Back-filling-quot-arrays/m-p/141736#M296667</guid>
      <dc:creator>maroulator</dc:creator>
      <dc:date>2014-09-14T01:11:43Z</dc:date>
    </item>
  </channel>
</rss>

