I have the following code:
Data work.data;
length A $40;
infile datalines dsd;
Input A $;
Datalines;
uncouple between ETTX & TTGX
TTPX and ETTX uncoupled
separation between DTTX and
ETTX and ETTX
;
Run;
data work.blah;
set work.data;
blah = find(A,"ETTX" );
blah2 = find(A,"ETTX",blah+1);
car1 = substr(A,blah,4);
car2 = substr(A,blah2,4);
run;
here is the output:
what is the easiest way to have SAS scan a 'list' of characters to search for?
for example, I not only want to search for ETTX, but DTTX, TTPX, TTGX, as well as others that aren't in this example. is there a way for SAS to scan for the first instance of these characters and output that, and then scan again and output the second occurance?
this is what i need the output to look like:
and you can see the order of car1 and car2 outputs have changed too.
... View more