Hello!
I get this message when trying to concatenate.
WARNING:In a call to the CATS function, the buffer allocated for the result was not long enough to contain the concatenation of all the arguments. The correct result would contain 5420 characters, but the actual result might either be truncated to 200 character(s) or be completely blank, depending on the calling environment. The following note indicates the left-most argument that caused truncation.
NOTE: Argument 1 to function CATS('TUEF11846042'[12 of 32000 characters shown],'BC07BCC00210'[12 of 200 characters shown],'ES02** '[12 of 32000 characters shown]) at line 1722 column 14 is invalid.
I have 3 character variables. Acct, Header, String; I need to add String inside Header after a certain criteria is met.
Note: header is very long. A shortened version of it looks like this:
Header=016420502CCBC07BCC012001071220000BC07BCC025601071540397BC07BCC028201071220000ES02**
String=BC07BCC002101010BC07BCC0206010423.4BC07BCC00440102-3
I need to add String in Header after the last BC07(and its value) .
Header_new should look like: 016420502CCBC07BCC012001071220000BC07BCC025601071540397BC07BCC028201071220000BC07BCC002101010BC07BCC0206010423.4BC07BCC00440102-3ES02**
This is my code:
data want;set have;
b= find(header,'BC07',-length(header));/*position of last 'BC07'*/
length_of_value=input(substrn(header,find(header,'BC07',-length(header)) + 13),2.);
frst_string=substrn(header,1, (find(header,'BC07',-length(header))) + 14 + (input(substrn(header,find(header,'BC07',-length(header)) + 13),2.)));
last_string=substrn(header,b + 15 + length_of_value,length(header) - b + 15 + length_of_value);
header_new=cats(frst_string,string,last_string);
run;
Can anyone help me with this? I'm guessing the problem is with the length of the characters but I have no idea how to fix it.
Thanks in Advance.
... View more