Date: Wed, 20 Jun 2007 16:05:32 -0400
Reply-To: "Martyn, Roman" <Roman.Martyn@BMO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Martyn, Roman" <Roman.Martyn@BMO.COM>
Subject: Re: data manipulation
In-Reply-To: A<200706201854.l5KAkKsf022708@malibu.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"
Once you create your loan dataset, you could also transpose that and
create a new text variable for description, concatenating the result (if
you want it in the same field):
proc transpose data=loan out=loan_trans;
var _numeric_;
run;
data loan2;
set loan_trans;
length description $30.;
if index(_NAME_,'abc') then description = 'Number of Loans
ABC'||''||left(trim(put(COL1, $3.))); else if index(_NAME_,'xyz') then
description = 'Number of Loans XYZ'||''||left(trim(put(COL1, $3.)));
run;
Roman Martyn | BMO - Bank of Montreal | Marketing, Analytics and
Campaigns | Roman.Martyn@bmo.com
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
mesecca L katram
Sent: June 20, 2007 2:54 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: data manipulation
data abc;
input loans month;
datalines;
1000 1
1001 3
1004 4
1007 3
;
run;
data xyz;
input loan year;
datalines;
2004 1
2005 3
2006 4
2007 3
2001 3
2004 4
2008 3
;
run;
PROC SQL ;
SELECT COUNT(loans) INTO :x FROM abc ;
SELECT COUNT(loan) INTO :y FROM xyz;
QUIT;
data loan;
Number_of_loans_in_abc=&x;
Number_of_loans_in_xyz=&y;
run;
I need to report number of loans on each data set if I run the above
data
step.I report then in
the following
Number_of_loans_in_abc Number_of_loans_in_xyz
4 7
but I want the data set
Numberofloans
abc 4
xyz 7
is it possible?