Date: Thu, 7 Aug 2008 12:29:28 +0530
Reply-To: Madan Gopal Kundu <Madan.Kundu@RANBAXY.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Madan Gopal Kundu <Madan.Kundu@RANBAXY.COM>
Subject: Re: Plz help me in logic
Content-Type: text/plain; charset="us-ascii"
Another way to do is as follows. In my earlier code I did not use byte
function. Here I have used byte function.
data one;
length new $ 200;
do i=1 to 26;
len=i-1;
new=byte(64+i);
if i>1 then do;
do rep=1 to len;
new=byte(64+i-rep)||compress(new)||byte(64+i-rep);
end;
end;
output;
end;
keep new;
run;
Madan Gopal Kundu
Biostatistician, CDM, MACR, Ranbaxy Labs. Ltd.
Tel(O): +91 (0) 1245194045 - Mobile: +91 (0) 9868788406
-----Original Message-----
From: Madan Gopal Kundu
Sent: Thursday, August 07, 2008 11:32 AM
To: 'chittiprolu pradeep'; SAS-L@LISTSERV.UGA.EDU
Subject: RE: Plz help me in logic
The following code may help you:
data two;
v1='A'; v2='B'; v3='C'; v4='D'; v5='E'; v6='F'; v7='G'; v8='H';
v9='I'; v10='J'; v11='K'; v12='L'; v13='M'; v14='N'; v15='O';
v16='P'; v17='Q'; v18='R'; v19='S'; v20='T'; v21='U'; v22='V';
v23='W'; v24='X'; v25='Y'; v26='Z';
run;
data one;
set two;
length new $ 200;
array lett v1 - v26 ;
do i=1 to dim(lett);
len=i-1;
new=lett(i);
if i>1 then do;
do rep=1 to len;
new=lett(i-rep)||compress(new)||lett(i-rep);
end;
end;
output;
end;
keep new;
run;
Cheers!
Madan Gopal Kundu
Biostatistician, CDM, MACR, Ranbaxy Labs. Ltd.
Tel(O): +91 (0) 1245194045 - Mobile: +91 (0) 9868788406
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
chittiprolu pradeep
Sent: Thursday, August 07, 2008 10:59 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Plz help me in logic
Hi All,
Please help in logical coding for getting the output as given below:
A
ABA
ABCBA
ABCDCBA
and so on....
--
--
--
--
--
--
--
. .......Z .......
how can i create this ?
Thanks,
(i) The information contained in this e-mail message is intended only
for the confidential use of chittiprolupradeep@GMAIL.COM;SAS-L@LISTSERV.UGA.EDU.
This message is privileged and confidential. If the reader of this message
is not the intended recipient or an agent responsible for delivering it to the
intended recipient, you are hereby notified that you have received this
document in error and that any review, dissemination, distribution, or
copying of this message is strictly prohibited. If you have received this
communication in error, please notify us immediately by e-mail, and delete
the original message.
(ii) Madan.Kundu@ranbaxy.com confirms that Ranbaxy shall not be responsible if this
email message is used for any indecent, unsolicited or illegal purposes,
which are in violation of any existing laws and the same shall solely be
the responsibility of Madan.Kundu@ranbaxy.com and that Ranbaxy shall at all times be
indemnified of any civil and/ or criminal liabilities or consequences there.