<div dir="ltr">I have an R package that can do that out of the box. The command is as simple as:<div>convert(&quot;yourfile.dta&quot;, to = &quot;DDI&quot;)</div><div><br></div><div>The latest development version depends on another R package called &quot;haven&quot;, which (in its latest development version but yet not published on CRAN) can read and write Stata style defined missing values such as .a, .b etc.</div><div>In the XML codebook file, they are automatically (and consistently across all variables) replaced with negative numbers such as -1, -2 etc.</div><div><br></div><div>Both development versions can be installed from GitHub, using:</div><div><br></div><div>library(remotes)</div><div>install_github(&quot;tidyverse/haven&quot;)</div><div>install_github(&quot;dusadrian/DDIwR&quot;)</div><div><br></div><div>I&#39;d be happy to be of assistance in case you need any help.</div><div><br></div><div>I hope this helps,</div><div>Adrian</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 23, 2021 at 9:23 PM Wendy Thomas &lt;<a href="mailto:wlt@umn.edu">wlt@umn.edu</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">I had this question within another conversation recently and was wondering what people were using and if there were any new tools out there.<div><br></div><div>&quot;While I have your attention: what is the process of creating the DDI codebooks based on existing data sets? Suppose I have a labeled data set in Stata, what would I need to do to produce a DDI codebook XML file out if it? &quot;</div><div><br></div><div>Answer to the list. I&#39;ll compile and I&#39;m sure others are interested.</div><div><br></div><div>Wendy<br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Wendy L. Thomas                              Phone: +1 612.624.4389</div><div>Data Access Core Director                 Fax:   +1 612.626.8375</div><div>Minnesota Population Center             Email: <a href="mailto:wlt@umn.edu" target="_blank">wlt@umn.edu</a></div><div>University of Minnesota</div><div>50 Willey Hall</div><div>225 19th Avenue South</div><div>Minneapolis, MN 55455</div></div></div></div></div>
_______________________________________________<br>
DDI-users mailing list<br>
<a href="mailto:DDI-users@icpsr.umich.edu" target="_blank">DDI-users@icpsr.umich.edu</a><br>
<a href="http://lists.icpsr.umich.edu/mailman/listinfo/ddi-users" rel="noreferrer" target="_blank">http://lists.icpsr.umich.edu/mailman/listinfo/ddi-users</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div>Adrian Dusa<br>University of Bucharest<br>Romanian Social Data Archive<br>Soseaua Panduri nr. 90-92<br>050663 Bucharest sector 5<br>Romania</div><div><a href="https://adriandusa.eu" target="_blank">https://adriandusa.eu</a></div></div></div></div></div></div>