Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: appending or tostring programming issue


From   Laura Gibbons <gibbonsl@u.washington.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: appending or tostring programming issue
Date   Thu, 21 Sep 2006 14:28:07 -0700 (PDT)

I have a program that prepares data (and code) for a DOS-based program.
I need a line above the actual data that is of the form:

NPKY XXXX

with the data below, so it looks like:

NPKY XXXX
10000000011234
10000000022398
...
etc.

I had done this by creating a one line tempfile with a string variable with value "NPKY XXXX" and appending the data file to that file.
Because this first line is in string format, I had to -tostring- the data as well. No problem until a user tried a file with 90,000 different id's;more than the 65,000+ that tostring allows.

Is there a way to generate the header and the data and concatonate them without using append? This way I could keep the id's in numeric format.

Or a way to work around the tostring limitation?

thanks- Laura

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Laura E. Gibbons, PhD
General Internal Medicine, University of Washington
Box 359780
Harborview Medical Center
325 Ninth Avenue, Seattle, WA 98104

phone: 206-744-1842 fax: 206-744-9917
Office address: 401 Broadway, Suite 5122
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index