for anyone being SAS developer, I thought basic problem definition with little illustrations, should have been enough to understnad the problem at hand. However, I will try to explain again: Yes the user defined formats are defined in my session and a list of columns and their user defined formats is applied on the main table data with obvious statement: format &full_format_list; ---where, full_format_list is something like: (c1 X. c5 Y. c47 Z. ... etc) Output is our table that looks something like the one attached: (note: it is just the small snapshot of the table containing huge data and many comuns). format tables l1,l5,l47 etc have been created using : proc format cntlout = &outvals (keep = fmtname start label So my problem is : I need to join the main table with each of these format tables to gather the count and balance for each label value of the formats. something like this: select "&var_cat" as Category length=50,t2.LABEL as Categories,count(t1.acc_id) as N,t2.POU_DT,sum(BALANCE_AMT) as Balance from main_table t1 RIGHT OUTER JOIN l&i. t2 ON strip(put(t1.&&VARS&i.,32.))=t2.LABEL and t1.POU_DT=t2.pou_dt group by t2.pou_dt,t2.FMTNAME,t2.LABEL order by t2.LABEL,t2.pou_dt asc; but the join fails as operands on either side of = are of different formats for obvious reasons. So I need the entire main_table to be in character format. If there is any way other than proc transpose applied twice, please let me know. Thanks in advance!
... View more