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]

Re: st: RE: RE: dictionary problem


From   David Kantor <[email protected]>
To   [email protected]
Subject   Re: st: RE: RE: dictionary problem
Date   Wed, 16 Oct 2013 12:42:36 -0400

Hello Matthew,

If you have the data in SAS form, you should use Stat/Transfer.
If you are translating SAS code to a dictionary, you should use SASdecoder -- available from Circle Systems or from www.essistant-software.com. I can provide you -- or any other Statalist members -- with an evaluation license if you write to me privately: [email protected].
HTH
--David


At 09:22 AM 10/16/2013, you wrote:
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: [email protected] [mailto:[email protected]] On Behalf Of Joe Canner
Sent: Wednesday, October 16, 2013 9:11 AM
To: [email protected]
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: [email protected] [mailto:[email protected]] On Behalf Of DeMichele, Matthew
Sent: Wednesday, October 16, 2013 8:48 AM
To: [email protected]
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/


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