12-02-2014 12:31 PM
data test (keep=ln_no BO_BORR_FST_NM
BO_BORR_LAST_NM BO_BORR_MDL_NM BO_BORR_NM YE_BORR_ID_NO);
if ye_borr_id_no in ('9897'
Is there an alternative process to include all of the numbers in quotes without having to physically place quotes between all values. For example '9897'. I have about 900 of these to place after the ye_borr_id_no. I know I can do a table using cards like this
input id_no $4.;
I just need to perhaps incorporate this into the datastep.
12-02-2014 01:16 PM
Create the table test and use a SQL query instead:
create table want as
from data1 where ye_borr_id_no in (select id_no from test);
12-02-2014 01:26 PM
For 900 you are better off using a data set and using SQL or MERGE to do the sub setting.
But if you want to generated quoted list from space delimited list than TRANWRD can help.
%let list=9897 4231 6240 ;
%let qlist="%sysfunc(tranwrd(&list,%str( )," "))";
12-02-2014 03:54 PM
And yet another way:
proc format library=work;
3708 = 'Valid'
do x= '9897','5555';
if put(x,$mylist.)='Valid' then put 'In list';
else put 'not in list';