<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: why  the data set transforing from .xpt does't have variables ? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779692#M81204</link>
    <description>&lt;P&gt;Your code that you have shared does not involve any file name ending in "RHQ C.xpt" that appears in your error message.&lt;/P&gt;
&lt;P&gt;If you copied anything for file names you might want to delete and TYPE them just in case you have a hidden character that is getting interpreted as C (or whatever, the font in the image is too small for me to read easily).&lt;/P&gt;
&lt;P&gt;Or is occurring from code you haven't managed to share yet.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Nov 2021 02:05:57 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-11-11T02:05:57Z</dc:date>
    <item>
      <title>why  the data set transforing from .xpt does't have variables ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779637#M81196</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tianerhu_1-1636574009719.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65569i4802179C23AD9A16/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tianerhu_1-1636574009719.png" alt="tianerhu_1-1636574009719.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I download the file from :&lt;/P&gt;
&lt;P&gt;&lt;A href="https://wwwn.cdc.gov/Nchs/Nhanes/Search/DataPage.aspx?Component=Questionnaire&amp;amp;Cycle=1999-2000" target="_blank"&gt;https://wwwn.cdc.gov/Nchs/Nhanes/Search/DataPage.aspx?Component=Questionnaire&amp;amp;Cycle=1999-2000&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then transform this rhq_c.xpt to SAS data set using the following code :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename xptIn url "C:\SAS data and program\data\data set from NHANES/DEMO_I.xpt"; 
libname xptIn xport;

* Download and inport the xpt file and save as a temporary SAS dataset in your work directory *;
* using Proc COPY *;
proc copy in=xptIN out=work;
run;

* or using a data step *;
data demo_i;
  set xptIn.demo_i;
run;

* To save a permanent SAS dataset *;
** TutorialUser: update this libname to reference a directory on your hard drive where you want to save the dataset **;
libname mydata "C:\SAS data and program\data\data set from NHANES";

data mydata.demo_i;
  set xptIn.demo_i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and finally, I want to check the variables using the following code :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data = mydata.rhq_c;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and the output like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tianerhu_2-1636574329601.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65570iC3AB8C383E1665D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tianerhu_2-1636574329601.png" alt="tianerhu_2-1636574329601.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;why ？ please give me&amp;nbsp; a help.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 19:59:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779637#M81196</guid>
      <dc:creator>tianerhu</dc:creator>
      <dc:date>2021-11-10T19:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: why  the data set transforing from .xpt does't have variables ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779640#M81197</link>
      <description>&lt;P&gt;The data set referenced in PROC CONTENT isn't the same one shown in your code. &lt;BR /&gt;Are you sure you're referencing the correct data set?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/268447"&gt;@tianerhu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tianerhu_1-1636574009719.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65569i4802179C23AD9A16/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tianerhu_1-1636574009719.png" alt="tianerhu_1-1636574009719.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I download the file from :&lt;/P&gt;
&lt;P&gt;&lt;A href="https://wwwn.cdc.gov/Nchs/Nhanes/Search/DataPage.aspx?Component=Questionnaire&amp;amp;Cycle=1999-2000" target="_blank" rel="noopener"&gt;https://wwwn.cdc.gov/Nchs/Nhanes/Search/DataPage.aspx?Component=Questionnaire&amp;amp;Cycle=1999-2000&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then transform this rhq_c.xpt to SAS data set using the following code :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename xptIn url "C:\SAS data and program\data\data set from NHANES/DEMO_I.xpt"; 
libname xptIn xport;

* Download and inport the xpt file and save as a temporary SAS dataset in your work directory *;
* using Proc COPY *;
proc copy in=xptIN out=work;
run;

* or using a data step *;
data demo_i;
  set xptIn.demo_i;
run;

* To save a permanent SAS dataset *;
** TutorialUser: update this libname to reference a directory on your hard drive where you want to save the dataset **;
libname mydata "C:\SAS data and program\data\data set from NHANES";

data mydata.demo_i;
  set xptIn.demo_i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and finally, I want to check the variables using the following code :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data = mydata.rhq_c;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and the output like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tianerhu_2-1636574329601.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65570iC3AB8C383E1665D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tianerhu_2-1636574329601.png" alt="tianerhu_2-1636574329601.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;why ？ please give me&amp;nbsp; a help.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 20:15:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779640#M81197</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-11-10T20:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: why  the data set transforing from .xpt does't have variables ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779642#M81198</link>
      <description>&lt;P&gt;If the file is on your C drive why are you using the URL engine?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname xptIn xport "C:\SAS data and program\data\data set from NHANES\DEMO_I.xpt"; 

* Create work datasets using Proc COPY *;
proc copy in=xptIN out=work;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that the XPORT libref engine is one of the few SAS engines that can actually handle reading from the URL filename engine, so you do not really need to save a copy of the XPT file.&amp;nbsp; Just save the SAS dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename url url "https://wwwn.cdc.gov/Nchs/Nhanes/2015-2016/DEMO_I.XPT";
libname url xport;
proc copy inlib=url outlib=work;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 20:14:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779642#M81198</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-11-10T20:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: why  the data set transforing from .xpt does't have variables ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779653#M81199</link>
      <description>&lt;PRE id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr" style="text-align: left;" data-placeholder="Translation"&gt;&lt;SPAN class="Y2IQFc"&gt;This result is the same as mine before&lt;/SPAN&gt;. &lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tianerhu_0-1636580926757.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65571i8F69EEF38A6AA022/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tianerhu_0-1636580926757.png" alt="tianerhu_0-1636580926757.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 21:48:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779653#M81199</guid>
      <dc:creator>tianerhu</dc:creator>
      <dc:date>2021-11-10T21:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: why  the data set transforing from .xpt does't have variables ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779655#M81200</link>
      <description>&lt;A href="https://wwwn.cdc.gov/nchs/data/tutorials/file_download_import_SAS.sas" target="_blank"&gt;https://wwwn.cdc.gov/nchs/data/tutorials/file_download_import_SAS.sas&lt;/A&gt;&lt;BR /&gt;my code is from here . I just copy.&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Nov 2021 21:50:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779655#M81200</guid>
      <dc:creator>tianerhu</dc:creator>
      <dc:date>2021-11-10T21:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: why  the data set transforing from .xpt does't have variables ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779669#M81201</link>
      <description>&lt;P&gt;DEMO_I is the demography XPT file, which is not listed in your initial file link.&lt;/P&gt;
&lt;P&gt;Are you pointing to the demographic file or the RHQ file? Did you update the code to reflect the file name of the XPT file downloaded?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It works when using the RHQ file but make sure that the case is correct. Seems like it's all upper case. I tested this in On Demand and it worked.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname xptIn xport "/home/fkhurshed/Demo1/RHQ.XPT"; 
libname demo '/home/fkhurshed/Demo1';
* Download and inport the xpt file and save as a temporary SAS dataset in your work directory *;
* using Proc COPY *;
proc copy in=xptIN out=demo;
run;

proc contents data=demo.RHQ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 23:20:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779669#M81201</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-11-10T23:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: why  the data set transforing from .xpt does't have variables ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779672#M81202</link>
      <description>&lt;P&gt;now I can see how many variables using contents procedure. But ,&amp;nbsp; why does a message appear?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tianerhu_0-1636587186409.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65572i42E6EAA43DE8F992/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tianerhu_0-1636587186409.png" alt="tianerhu_0-1636587186409.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The following is my code :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname xptIn xport "C:\SAS data and program\data\data set from NHANES/RHQ.XPT";
libname demo "C:\SAS data and program\data\data set from NHANES";
* Download and inport the xpt file and save as a temporary SAS dataset in your work directory *;
* using Proc COPY *;
proc copy in=xptIn out=demo;
run;

proc contents data=demo.RHQ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and the following is information from log:&lt;/P&gt;
&lt;PRE&gt;441  libname xptIn xport "C:\SAS data and program\data\data set from NHANES/RHQ.XPT";
NOTE: Libref XPTIN was successfully assigned as follows:
      Engine:        XPORT
      Physical Name: C:\SAS data and program\data\data set from NHANES\RHQ.XPT
442  libname demo "C:\SAS data and program\data\data set from NHANES";
NOTE: Libref DEMO refers to the same physical library as MYDATA.
NOTE: Libref DEMO was successfully assigned as follows:
      Engine:        V9
      Physical Name: C:\SAS data and program\data\data set from NHANES
443  * Download and inport the xpt file and save as a temporary SAS dataset in your work directory
443!  *;
444  * using Proc COPY *;
445  proc copy in=xptIn out=demo;
446  run;

NOTE: Input library XPTIN is sequential.
NOTE: Copying XPTIN.RHQ to DEMO.RHQ (memtype=DATA).
NOTE: BUFSIZE is not cloned when copying across different engines.
      System Option for BUFSIZE was used.
NOTE: There were 3517 observations read from the data set XPTIN.RHQ.
NOTE: The data set DEMO.RHQ has 3517 observations and 90 variables.
NOTE: PROCEDURE COPY used (Total process time):
      real time           0.04 seconds
      cpu time            0.04 seconds


447
448  proc contents data=demo.RHQ;
449  run;

NOTE: PROCEDURE CONTENTS used (Total process time):
      real time           0.04 seconds
      cpu time            0.04 seconds


&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 23:35:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779672#M81202</guid>
      <dc:creator>tianerhu</dc:creator>
      <dc:date>2021-11-10T23:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: why  the data set transforing from .xpt does't have variables ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779686#M81203</link>
      <description>What triggered the error?</description>
      <pubDate>Thu, 11 Nov 2021 01:47:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779686#M81203</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-11-11T01:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: why  the data set transforing from .xpt does't have variables ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779692#M81204</link>
      <description>&lt;P&gt;Your code that you have shared does not involve any file name ending in "RHQ C.xpt" that appears in your error message.&lt;/P&gt;
&lt;P&gt;If you copied anything for file names you might want to delete and TYPE them just in case you have a hidden character that is getting interpreted as C (or whatever, the font in the image is too small for me to read easily).&lt;/P&gt;
&lt;P&gt;Or is occurring from code you haven't managed to share yet.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 02:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779692#M81204</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-11-11T02:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: why  the data set transforing from .xpt does't have variables ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779695#M81205</link>
      <description>&lt;P&gt;Thank you all for your help.&lt;/P&gt;
&lt;P&gt;I have find the error.&lt;/P&gt;
&lt;P&gt;using slash instead of backslash .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 03:20:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/why-the-data-set-transforing-from-xpt-does-t-have-variables/m-p/779695#M81205</guid>
      <dc:creator>tianerhu</dc:creator>
      <dc:date>2021-11-11T03:20:04Z</dc:date>
    </item>
  </channel>
</rss>

