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: generated file with append command has more than allowable number of variables


From   daniel klein <[email protected]>
To   [email protected]
Subject   Re: st: generated file with append command has more than allowable number of variables
Date   Mon, 11 Mar 2013 16:56:56 +0100

You do not need to type all the variable names by hand. Try something like this

u <shorter_file> ,clear
unab vars : *
loc vars `vars' <varnames_to_add>
ap using <longer_file> ,keep(`vars')

where, obviously, you do not type the < and >, and replace the content
inside with whatever filenames, and variable names you have.

Best
Daniel
-- 
Hi all,

I have two files, one (A) with 2045 variables while another (B) has
1055 variables. I wanted to append to A using B.
However since there are some variables in B which are not in A,  I end
up with more than the allowable 2048 variables for my version of STATA
(STATA 12)

I have to use the option "keep" and list what I want from B. This for
sure is too long a command.

I
 only wanted to append to those variables already in A from B and maybe
add two new variables, thus remaining with either 2045 or with 2047 variables.

I am
using data from a cohort of individuals we have been following for over
10 years with many variables standing for questions asked at each
survey round (64 page
questionnaire).

Is there a command I can use to only append to
those variables that are already in my working file (A) and maybe also "keep"
only two more variables?

Thank you
*
*   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