Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: individual column/dataset properties


From   Rafal Raciborski <[email protected]>
To   Stata_list <[email protected]>
Subject   st: individual column/dataset properties
Date   Sat, 17 Dec 2005 12:17:37 -0500

is there a way to impose certain restrictions on individual columns in a Stata dataset? e.g., numeric values must be in the range [0,30] and integers or, for a SSN column, character values must be of the format XXX-XX-XXXX and, at the same time, must be of length 11. if they are not, the user will be warned and the change/input rejected.

furthermore, is there a way to password-protect an individual column/whole dataset so that only authorized users can copy/modify it? a milder protection could be that one can make an unprotected copy of the protected column/dataset and modify the copy; a stricter protection would not even allow making changes in copies (or even copying in the first place).

i was thinking about something like:

-----------------
attribute command
-----------------

attr var1, range(0,30) & integer
attr var2, range(>1)

attr var3, format(nnn-nn-nnnn) & length(11)
attr var4, format(CC) // meaning two capitalized characters

attr dir
attr list var1
attr drop var1
attr drop _all


------------------
protection command
------------------

protect var1 "password", mild // default is strict
protect data "password"

protect // a general query whether password-protection exists
protect drop var1 "password" // eliminates protection
protect drop data "password"


rafal


================
Rafal Raciborski
Graduate student
Department of Political Science
Emory University
301 Tarbutton Hall
1555 Dickey Drive Atlanta, GA 30322
404-378-9826 (home)
[email protected]
http://www.roofoos.net/


*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index