Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: RE: dictionary problem


From   "DeMichele, Matthew" <mdemichele@rti.org>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: dictionary problem
Date   Wed, 16 Oct 2013 09:22:30 -0400

Hi Joe:
Thank you so much for the suggestion. Changing to str8 worked!!! I've been struggling with this issue for a couple of days (trying an assortment of combinations and version, and have brought in several others that I work with). Thank you!!

Best, Matthew 



-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Joe Canner
Sent: Wednesday, October 16, 2013 9:11 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: dictionary problem

Matthew,

I think you need to make the type for osc_1 -str8- instead of -str-.  Stata interprets -str- as a variable name and you apparently had another -str- in the redacted portion of your dictionary.

You are allowed to use -str- in an infix dictionary, but apparently not in an infile dictionary, even with a format of %8s.

Incidentally, an infix dictionary might be more suitable for your data, which appears (based on the snippet you provided) to be regular enough that you can get by without the _column and format specifications.

If money and/or time is no object, I would agree with the previous post that StatTransfer might be worth considering.

Regards,
Joe Canner
Johns Hopkins University School of Medicine

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of DeMichele, Matthew
Sent: Wednesday, October 16, 2013 8:48 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: dictionary problem

Hello statalisters:
I've been tasked with transferring SAS setup codes for a large survey into Stata and SPSS. The SPSS conversion has gone pretty smoothly and the setup files run (which makes sense because SAS and SPSS have many programming similarities). Stata, on the other hand, is not going as smoothly. 

I'm new to running Stata dictionary files, so I assume I'm making a simple mistake that may be obvious to the more experienced Stata users. My dct file is abbreviated below (and the variable names and values are altered because of the nature of the collection), as well I've left out several variables in the output just for simplicity sake (i.e., the gap between line 25 and 131). Any suggestions are greatly appreciated. 

Best regards, Matthew 

. infile using `dict', using (`raw_data') clear
dictionary   {
_lines(1)
_line(1)

_column (1)  int        db                           %8f             	 " BIRTH" 
_column (9)  int        pd           		%8f              	" ADMISSION " 
_column (17) int        pr                     	%8f             	 " RELEASE" 
_column (25) int        pe                       	%8f      		" ELIGIBILITY " 
..... 
_column (131) str       osc_1           	 %8s              	"OFFENSE #1 -" 
str already defined
dictionary invalid
r(614);


> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index