Thanks as always to Kit Baum, new versions of the xdir and descsave packages are now available for download from SSC. In Stata, use the ssc command to do this, or adoupdate if you already have an old version of xdir or descsave.

The xdir and descsave packages are described as below on my website. The new versions have been updated to Stata Version 16, and have a new option

frame( framename [ , replace change ] )

enabling the user to save the output dataset (or resultsset) into a data frame. Data frames were added to Stata in Stata Version 16, and enable multiple datasets to be in memory at the same time.

Users of older versions of Stata can still download older versions of xdir and descsave from my website by typing, in Stata,

net from http://www.rogernewsonresources.org.uk/

and selecting the most recent version of Stata with a version of xdir or descsave in a version of Stata at or below their own. For instance, users of Stata Versions 10 to 15 can download the Stata Version 10 version of descsave by typing

net describe descsave, from(http://www.rogernewsonresources.org.uk/stata10)

and descrbe the Stata 10 version of Descsave, and install it if they want to.

Best wishes

Roger

---------------------------------------------------------------------------------
package xdir from http://www.rogernewsonresources.org.uk/stata16
-----------------------------------------------------------------------------------

TITLE
xdir: Create a resultsset with 1 observation per file in a directory

DESCRIPTION/AUTHOR(S)
xdir is an extended version of dir, or of the extended macro function
dir. It creates an output dataset (or resultsset), with 1 observation
for each file in a user-specified directory conforming to a
user-specified pattern, and belonging to a user-specified file type,
and data on the file name and the directory name. This dataset may be
listed using the list() option and/or saved to a data frame using the
frame() option and/or saved to a file using the saving() option and/or
written to the memory using the norestore or fast option, overwriting
any existing dataset. Alternatively (or additionally), a list of the
file names may be saved in a local macro, using the local() option or
the plocal() option.

Author: Roger Newson
Distribution-Date: 04september2019
Stata-Version: 16

INSTALLATION FILES (click here to install)
xdir.ado
xdir.sthlp
-----------------------------------------------------------------------------------
(click here to return to the previous screen)

-----------------------------------------------------------------------------------
package descsave from http://www.rogernewsonresources.org.uk/stata16
-----------------------------------------------------------------------------------

TITLE
descsave: Save descriptive attributes of variables to a do-file and/or a
Stata dataset

DESCRIPTION/AUTHOR(S)
descsave is an extended version of describe, which lists descriptive
attributes for a list of variables in a dataset given by varlist, or for all
variables in the dataset if varlist is not specified. The dataset is the
current dataset in memory, unless using is used to specify a dataset in a
file. The descriptive attributes are variable names, storage types, display
formats, value labels and variable labels (as output by describe), and also
(optionally) a list of characteristics specified by the charlist() option.
descsave creates an output Stata dataset (or resultsset) with one observation
per variable and data on these descriptive attributes. This dataset may be
listed using the list() option and/or saved to a data frame using the frame()
option and/or saved to a file using the saving() option and/or written to the
memory using the norestore or fast option, overwriting any existing dataset.
The file specified by dofile() is a do-file, containing commands which can be
run to reconstruct the descriptive attributes of the variables, assuming that
variables of the same names have been created and are numeric or character as
appropriate. descsave can be used together with export delimited to create a
definitive generic spreadsheet version of the current dataset, together with
a Stata do-file to reconstruct the descriptive attributes of the variables
after the spreadsheet has been input using import delimited.

Author: Roger Newson
Date: 04 September 2019
Stata version: 16

INSTALLATION FILES (click here to install)
descsave.ado
descsave.sthlp
-----------------------------------------------------------------------------------
(click here to return to the previous screen)