<?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 Automation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Automation/m-p/677384#M204319</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am working on one challenge and I am unable to resolve the error message.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have file1 with customer info:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;cust#;date
1234;20200104
1234;20200105
1234;20200106
1233;20200204
1233;20200221
1233;20200213
1222;20200520
1222;20200522
1222;20200523&lt;/PRE&gt;
&lt;P&gt;I have another file with a script:&lt;/P&gt;
&lt;PRE&gt;ftp &amp;lt;server&amp;gt;
user pwd
cd /temp/folder/
  put filename_cust_dyymmdd     filename_cust_dyymmdd.txt
&lt;/PRE&gt;
&lt;P&gt;for each value in file1, I need to dynamically generate individual FTP scripts by replacing cust with cust# and yymmdd with date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used array to load the script as shown in below code:&lt;/P&gt;
&lt;PRE&gt;DATA script1                ;                      
   FORMAT LI1-LI4  $100.;                      
   RETAIN LI1-LI4 ;                           
   ARRAY LI{150}  $ ;                           
   INFILE script1   TRUNCOVER END=EOF;             
   INPUT @001 LI01   $100. ;                     
   I = _N_;                                     
   LI{I} = LI01;                                
   IF EOF THEN OUTPUT ;                         
RUN;                                            &lt;/PRE&gt;
&lt;P&gt;and then&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _null_
array li{4}   $;
format line     $100. ;
set file1;       /* cust# and date */
if _n_ = 1 then set script1;
for i = 1 to 4;
      line = li{i};
      &lt;EM&gt;if i = 4 then do;&lt;BR /&gt;            string update/replace using substr&lt;BR /&gt;&lt;/EM&gt;      end;
       @001 put line   $100.;
end;

run;&lt;/PRE&gt;
&lt;PRE&gt;WARNING: Multiple lengths were specified for the variable LI1 by input data set(s). This can cause truncation of data.    &lt;/PRE&gt;
&lt;P&gt;I am able to get multiple scripts as per file1 but values are truncated (only first 8 bytes are written) and not as expected.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can someone help why I am getting truncation warning.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Aug 2020 04:17:13 GMT</pubDate>
    <dc:creator>gskn4u</dc:creator>
    <dc:date>2020-08-18T04:17:13Z</dc:date>
    <item>
      <title>Automation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automation/m-p/677384#M204319</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am working on one challenge and I am unable to resolve the error message.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have file1 with customer info:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;cust#;date
1234;20200104
1234;20200105
1234;20200106
1233;20200204
1233;20200221
1233;20200213
1222;20200520
1222;20200522
1222;20200523&lt;/PRE&gt;
&lt;P&gt;I have another file with a script:&lt;/P&gt;
&lt;PRE&gt;ftp &amp;lt;server&amp;gt;
user pwd
cd /temp/folder/
  put filename_cust_dyymmdd     filename_cust_dyymmdd.txt
&lt;/PRE&gt;
&lt;P&gt;for each value in file1, I need to dynamically generate individual FTP scripts by replacing cust with cust# and yymmdd with date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used array to load the script as shown in below code:&lt;/P&gt;
&lt;PRE&gt;DATA script1                ;                      
   FORMAT LI1-LI4  $100.;                      
   RETAIN LI1-LI4 ;                           
   ARRAY LI{150}  $ ;                           
   INFILE script1   TRUNCOVER END=EOF;             
   INPUT @001 LI01   $100. ;                     
   I = _N_;                                     
   LI{I} = LI01;                                
   IF EOF THEN OUTPUT ;                         
RUN;                                            &lt;/PRE&gt;
&lt;P&gt;and then&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _null_
array li{4}   $;
format line     $100. ;
set file1;       /* cust# and date */
if _n_ = 1 then set script1;
for i = 1 to 4;
      line = li{i};
      &lt;EM&gt;if i = 4 then do;&lt;BR /&gt;            string update/replace using substr&lt;BR /&gt;&lt;/EM&gt;      end;
       @001 put line   $100.;
end;

run;&lt;/PRE&gt;
&lt;PRE&gt;WARNING: Multiple lengths were specified for the variable LI1 by input data set(s). This can cause truncation of data.    &lt;/PRE&gt;
&lt;P&gt;I am able to get multiple scripts as per file1 but values are truncated (only first 8 bytes are written) and not as expected.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can someone help why I am getting truncation warning.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 04:17:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automation/m-p/677384#M204319</guid>
      <dc:creator>gskn4u</dc:creator>
      <dc:date>2020-08-18T04:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Automation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automation/m-p/677385#M204320</link>
      <description>&lt;PRE&gt;ARRAY LI{&lt;STRIKE&gt;150&lt;/STRIKE&gt; 4}  $ ; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Aug 2020 04:23:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automation/m-p/677385#M204320</guid>
      <dc:creator>gskn4u</dc:creator>
      <dc:date>2020-08-18T04:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Automation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automation/m-p/677386#M204321</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;PRE&gt;array li{4}   $100;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 04:25:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automation/m-p/677386#M204321</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-08-18T04:25:39Z</dc:date>
    </item>
  </channel>
</rss>

