LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2004, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 10 Aug 2004 10:51:06 -0600
Reply-To:     Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Subject:      Re: May be you've had this problem
Comments: To: jim.groeneveld@VITATRON.COM
Content-Type: text/plain; charset=us-ascii

There's one use for it - data obfuscation. Create a data set with a duplicate variable, and put the info you don't want ordinary users to be able to browse into the second variable.

-- JackHamilton@FirstHealth.com Manager, Technical Development Metrics Department, First Health West Sacramento, California USA

>>> "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM> 08/10/2004 1:56 AM >>> Hi friends,

Obviously it is not SI's intention to allow duplicate variable names. Where it still is possible, merely seems to be an accident, a bug, not a feature. I would not count on it and never want to think of such duplicates. You do not need it. If importing strange data with duplicate names then rename.

Regards - Jim. -- [MyWellKnownSig]

My computer will go to sleep, while I will be having a few days off.

[common disclaimer]

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of Andrew Bolton Sent: Tuesday, August 10, 2004 10:48 To: SAS-L@LISTSERV.UGA.EDU Subject: Re: May be you've had this problem

Blimey, didn't know it was possible. That's going into my handy links for future reference (just in case).

Cheers, Andy

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Jack Hamilton Sent: 09 August 2004 19:09 To: SAS-L@LISTSERV.UGA.EDU Subject: Re: May be you've had this problem

I agree that you probably don't want duplicate a variable name in a data set, but it is possible. One way to get one is explained in <http://support.sas.com/techsup/unotes/SN/003/003951.html>; I've encountered other ways, but each new release of SAS makes it more difficult.

Once you have such a data set, it's difficult to get the value of the second variable, but some procs allow it, and you could probably get to it in a data step using the data set information functions, or maybe using an array.

-- JackHamilton@FirstHealth.com Manager, Technical Development Metrics Department, First Health West Sacramento, California USA

>>> "Andrew Bolton" <Andrew.Bolton@IDENTEX.COM> 08/09/2004 8:22 AM >>> Vickey

Although it's impossible to have two variables with the same in a dataset, for whatever reason you'd want to do this (and I can't think of a single one) you could have the variables with the same label for printed output.

Hope this helps,

Andy

i.e.

data test; length x1 8. x2 8. x3 8.; label x1="x1" x2="x2" x3="x2"; input x1 x2 x3; datalines; 1 2 3 ; run;

Proc print data=test label; run;

gives

The SAS System

Obs x1 x2 x2

1 1 2 3

Hope this helps,

Andy

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Dunn, Toby Sent: 09 August 2004 15:48 To: SAS-L@LISTSERV.UGA.EDU Subject: Re: May be you've had this problem

Vickey,

Why would you want to do this? Secondly, how would you tell sas to do something to one x2 and not the second x2 (or vice versa)?

Toby Dunn

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Groeneveld, Jim Sent: Monday, August 09, 2004 8:36 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: May be you've had this problem

Hi Vickey,

CAN'T!!!

Regards - Jim. --

. . . . . . . . . . . . . . . . . . . . . .

[My ID]

My computer will go to sleep, while I will be having a few days off.

[common disclaimer]

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of vickey Sent: Monday, August 09, 2004 14:56 To: SAS-L@LISTSERV.UGA.EDU Subject: Re: May be you've had this problem

I tried the folowing code and every thing was fine...

data test; input x1 x2 x3; datalines; 1 2 3 ; run;

But when i assign the same variable name to 2 variables i mean my input satament is like input x1 x2 x2; then it is considering the last variable and not the second one.

CAN ANY ONE TELL ME THAT HOW TO SOLVE THIS PROBLEM...I WANNA MY DATA SET HAVING THE SAME VARIABLE NAME 2 TIMES.

thanx in advance vickey [.........]

________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________

_______________________________________________________________________ This e-mail and any files transmitted with it are confidential and intended solely for the individual or entity to whom they are addressed. Any views or opinions presented or expressed are those of the author(s) and do not necessarily represent those of Identex Limited or any of the WWAV Rapp Collins Group Company and no representation is given nor liability accepted for the accuracy or completeness of any information contained in this e-mail unless expressly stated to the contrary. If you are not the intended recipient you may not use, disseminate, forward, print or copy this e-mail, but please notify the sender that you have received it in error. This footnote also confirms that although this email message has been scanned for viruses, the recipient is responsible for ensuring that the email and contents have been swept and accepted by their own virus protection systems. Identex Limited, Beech House, Betts Way, Crawley, West Sussex, RH10 9GW. Registered in England No:2001897. Registered Office: 1 Riverside, Manbre Road, London, W6 9WA _____________________________________________________________________

The service is powered by MessageLabs. http://www.star.net.uk _______________________________________________________________________

________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________

_______________________________________________________________________ This e-mail and any files transmitted with it are confidential and intended solely for the individual or entity to whom they are addressed. Any views or opinions presented or expressed are those of the author(s) and do not necessarily represent those of Identex Limited or any of the WWAV Rapp Collins Group Company and no representation is given nor liability accepted for the accuracy or completeness of any information contained in this e-mail unless expressly stated to the contrary. If you are not the intended recipient you may not use, disseminate, forward, print or copy this e-mail, but please notify the sender that you have received it in error. This footnote also confirms that although this email message has been scanned for viruses, the recipient is responsible for ensuring that the email and contents have been swept and accepted by their own virus protection systems. Identex Limited, Beech House, Betts Way, Crawley, West Sussex, RH10 9GW. Registered in England No:2001897. Registered Office: 1 Riverside, Manbre Road, London, W6 9WA _____________________________________________________________________

The service is powered by MessageLabs. http://www.star.net.uk _______________________________________________________________________


Back to: Top of message | Previous page | Main SAS-L page