Hello,
I am working on one challenge and I am unable to resolve the error message.
I have file1 with customer info:
cust#;date 1234;20200104 1234;20200105 1234;20200106 1233;20200204 1233;20200221 1233;20200213 1222;20200520 1222;20200522 1222;20200523
I have another file with a script:
ftp <server> user pwd cd /temp/folder/ put filename_cust_dyymmdd filename_cust_dyymmdd.txt
for each value in file1, I need to dynamically generate individual FTP scripts by replacing cust with cust# and yymmdd with date.
I used array to load the script as shown in below code:
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;
and then
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}; if i = 4 then do;
string update/replace using substr
end; @001 put line $100.; end; run;
WARNING: Multiple lengths were specified for the variable LI1 by input data set(s). This can cause truncation of data.
I am able to get multiple scripts as per file1 but values are truncated (only first 8 bytes are written) and not as expected.
can someone help why I am getting truncation warning.
ARRAY LI{1504} $ ;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.