<?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 How to use %xpt2loc to convert Xport file generated by V8 machine into SAS data set? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-xpt2loc-to-convert-Xport-file-generated-by-V8-machine/m-p/277622#M269665</link>
    <description>&lt;P&gt;Hi, all:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using %xpt2loc auto macro statement to convert Xport file into SAS data set.&amp;nbsp; The Xport file was generated by V8 machine, and I'm using SAS 9.4 version.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;libname&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; source &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'c:\My documents\My SAS Files\IIT'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;xpt2loc&lt;/I&gt;&lt;/STRONG&gt;(libref=source, memlist=memlist,&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;filespec=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'c:\My documents\My SAS Files\IIT'\&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;Data_CID_Keymind_harddrive_&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;02.xpt'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; );&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;It gave me an error message, &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;ERROR: Physical file does not exist.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I did exported Xport file, I checked it showes 600KB size&amp;nbsp;with document type of SAS Xport Transport file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why? Please help, thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:45:37 GMT</pubDate>
    <dc:creator>ybz12003</dc:creator>
    <dc:date>2016-06-15T17:45:37Z</dc:date>
    <item>
      <title>How to use %xpt2loc to convert Xport file generated by V8 machine into SAS data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-xpt2loc-to-convert-Xport-file-generated-by-V8-machine/m-p/277622#M269665</link>
      <description>&lt;P&gt;Hi, all:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using %xpt2loc auto macro statement to convert Xport file into SAS data set.&amp;nbsp; The Xport file was generated by V8 machine, and I'm using SAS 9.4 version.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;libname&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; source &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'c:\My documents\My SAS Files\IIT'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;xpt2loc&lt;/I&gt;&lt;/STRONG&gt;(libref=source, memlist=memlist,&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;filespec=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'c:\My documents\My SAS Files\IIT'\&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;Data_CID_Keymind_harddrive_&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;02.xpt'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; );&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;It gave me an error message, &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;ERROR: Physical file does not exist.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I did exported Xport file, I checked it showes 600KB size&amp;nbsp;with document type of SAS Xport Transport file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why? Please help, thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:45:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-xpt2loc-to-convert-Xport-file-generated-by-V8-machine/m-p/277622#M269665</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2016-06-15T17:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to use %xpt2loc to convert Xport file generated by V8 machine into SAS data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-xpt2loc-to-convert-Xport-file-generated-by-V8-machine/m-p/277676#M269666</link>
      <description>&lt;P&gt;You have an extra quotation mark in your code. You can see it with the colour change in the file spec parameter.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:43:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-xpt2loc-to-convert-Xport-file-generated-by-V8-machine/m-p/277676#M269666</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-15T20:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to use %xpt2loc to convert Xport file generated by V8 machine into SAS data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-xpt2loc-to-convert-Xport-file-generated-by-V8-machine/m-p/277728#M269667</link>
      <description>&lt;P&gt;There are two kind of&amp;nbsp;Xport file, One is generated by PROC COPY, another is PROC CPORT. Make sure which one generate that XPT file .&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:38:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-xpt2loc-to-convert-Xport-file-generated-by-V8-machine/m-p/277728#M269667</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-06-16T01:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to use %xpt2loc to convert Xport file generated by V8 machine into SAS data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-xpt2loc-to-convert-Xport-file-generated-by-V8-machine/m-p/278324#M269668</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Hi Team&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;I don't think you need a macro to export/import SAS datasets using the V5 format or the CPORT format. see below for examples.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Note you can use proc fslist with recfm=f lrecl=80 to examine the header records or use the data step list option to detemine which format was used. Card image, 80 byte boundaries, are used for both formats.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;I don't think you need a macro to export/import SAS datasets.                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                
Below are sample header records for V5 transport and CPORT files.                                                                                                                                                                                               
You can use this to determine which type you have.                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                
data _null_;                                                                                                                                                                                                                                                    
 infile "d:/xpt/class.xpt" lrecl=80 recfm=f;                                                                                                                                                                                                                    
 input;                                                                                                                                                                                                                                                         
 list;                                                                                                                                                                                                                                                          
 if _n_=10 then stop;                                                                                                                                                                                                                                           
;run;quit;                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                
Here is what a header looks like for V5 transport                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                
RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8                                                                                                                                                                      
1         HEADER RECORD*******LIBRARY HEADER RECORD!!!!!!!000000000000000000000000000000                                                                                                                                                                        
2         SAS     SAS     SASLIB  9.4     X64_7PRO                        17JUN16:18:01:06                                                                                                                                                                      
RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8                                                                                                                                                                      
3         17JUN16:18:01:06                                                                                                                                                                                                                                      
4         HEADER RECORD*******MEMBER  HEADER RECORD!!!!!!!000000000000000001600000000140                                                                                                                                                                        
5         HEADER RECORD*******DSCRPTR HEADER RECORD!!!!!!!000000000000000000000000000000                                                                                                                                                                        
6         SAS     CLASS   SASDATA 9.4     X64_7PRO                        17JUN16:18:01:06                                                                                                                                                                      
7         17JUN16:18:01:06                                                                                                                                                                                                                                      
8         HEADER RECORD*******NAMESTR HEADER RECORD!!!!!!!000000000500000000000000000000                                                                                                                                                                        
                                                                                                                                                                                                                                                                
data _null_;                                                                                                                                                                                                                                                    
 infile "d:/cpt/class.cpt" lrecl=80 recfm=f;                                                                                                                                                                                                                    
 input;                                                                                                                                                                                                                                                         
 list;                                                                                                                                                                                                                                                          
 if _n_=10 then stop;                                                                                                                                                                                                                                           
;run;quit;                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                
Here is what a header looks like for CPORT. Incompressed it has 80 byte boundaries.                                                                                                                                                                             
                                                                                                                                                                                                                                                                
RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8                                                                                                                                                                      
1         **COMPRESSED** **COMPRESSED** **COMPRESSED** **COMPRESSED** **COMPRESSED********                                                                                                                                                                      
                                                                                                                                                                                                                                                                
2   CHAR  LIB CONTROL X64_7PRO¼. SAS9.4¼ƒI¼¥D901SASHELP CLASS¼™VC5¼‚RC19¼ˆRL40¼ˆ1¼‡S 0  0                                                                                                                                                                       
    ZONE  44424445544253353554B02545323B84BA43335454445244455B9543B85433B85433B83B85232232                                                                                                                                                                      
    NUMR  C9203FE42FC0864F702FC603139E4C39C5490131385C003C133C9635C22319C82C40C81C73000000                                                                                                                                                                      
3          12 NO¼„0¼‰1¼•ansi¼Š¼Î¼ÎStudent Data¼ÂSPAN CONTROL -7¼‚40¼…1¼†40¼ŠL¼ˆ40¼Ž¼&amp;amp;¼¦SPA                                                                                                                                                                      
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                
Here is code for V5 transport and CPORT                                                                                                                                                                                                                         
In V5 variable names cannot be longer than 8 chars and char vars can only hold up to 200 chars.                                                                                                                                                                 
Floats follow the IBM binary format not IEEE.                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                
* V5 export;                                                                                                                                                                                                                                           
libname xpt xport "d:/xpt/class.xpt";                                                                                                                                                                                                                           
data xpt.class;                                                                                                                                                                                                                                                 
 set sashelp.class;                                                                                                                                                                                                                                             
;run;quit;                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                
* V5 import;                                                                                                                                                                                                                                        
data class_import;                                                                                                                                                                                                                                              
  set xpt.class;                                                                                                                                                                                                                                                
;run;quit;                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                
*CPORT;                                                                                                                                                                                                                                                                
* V9.4M2 CPORT;                                                                                                                                                                                                                                       
options compress=no;                                                                                                                                                                                                                                            
proc cport data=sashelp.class file="d:/cpt/class.cpt" ;                                                                                                                                                                                                         
;run;quit;                                                                                                                                                                                                                                                      
 &lt;BR /&gt;CIMPORT                                                                                                                                                                                                                                                               
proc cimport data=classcpt file="d:/cpt/class.cpt";                                                                                                                                                                                                             
;run;quit;                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                
698   libname xpt xport "d:/xpt/xlass.xpt";                                                                                                                                                                                                                     
NOTE: Libref XPT was successfully assigned as follows:                                                                                                                                                                                                          
      Engine:        XPORT                                                                                                                                                                                                                                      
      Physical Name: d:\xpt\xlass.xpt                                                                                                                                                                                                                           
699   data xpt.class;                                                                                                                                                                                                                                           
700    set sashelp.class;                                                                                                                                                                                                                                       
701   ;run;                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                
NOTE: There were 19 observations read from the data set SASHELP.CLASS.                                                                                                                                                                                          
NOTE: The data set XPT.CLASS has 19 observations and 5 variables.                                                                                                                                                                                               
NOTE: DATA statement used (Total process time):                                                                                                                                                                                                                 
      real time           0.11 seconds                                                                                                                                                                                                                          
      user cpu time       0.01 seconds                                                                                                                                                                                                                          
      system cpu time     0.00 seconds                                                                                                                                                                                                                          
      memory              457.28k                                                                                                                                                                                                                               
      OS Memory           18936.00k                                                                                                                                                                                                                             
      Timestamp           06/17/2016 06:01:05 PM                                                                                                                                                                                                                
      Step Count                        129  Switch Count  0                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                
701 !      quit;                                                                                                                                                                                                                                                
702   data class_import;                                                                                                                                                                                                                                        
703     set xpt.class;                                                                                                                                                                                                                                          
704   ;run;                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                
NOTE: There were 19 observations read from the data set XPT.CLASS.                                                                                                                                                                                              
NOTE: The data set WORK.CLASS_IMPORT has 19 observations and 5 variables.                                                                                                                                                                                       
NOTE: DATA statement used (Total process time):                                                                                                                                                                                                                 
      real time           0.08 seconds                                                                                                                                                                                                                          
      user cpu time       0.00 seconds                                                                                                                                                                                                                          
      system cpu time     0.00 seconds                                                                                                                                                                                                                          
      memory              443.90k                                                                                                                                                                                                                               
      OS Memory           18936.00k                                                                                                                                                                                                                             
      Timestamp           06/17/2016 06:01:06 PM                                                                                                                                                                                                                
      Step Count                        130  Switch Count  0                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                
704 !      quit;                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                
proc cport data=sashelp.class file="d:/cpt/class.cpt";                                                                                                                                                                                                          
;run;quit;                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                
proc cimport data=classcpt file="d:/cpt/class.cpt";                                                                                                                                                                                                             
;run;quit;                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                
711   proc cport data=sashelp.class file="d:/cpt/class.cpt";                                                                                                                                                                                                    
712   ;run;                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                
NOTE: PROC CPORT begins to transport data set SASHELP.CLASS                                                                                                                                                                                                     
NOTE: The data set contains 5 variables and 19 observations.                                                                                                                                                                                                    
      Logical record length is 40.                                                                                                                                                                                                                              
NOTE: PROCEDURE CPORT used (Total process time):                                                                                                                                                                                                                
      real time           0.00 seconds                                                                                                                                                                                                                          
      user cpu time       0.00 seconds                                                                                                                                                                                                                          
      system cpu time     0.01 seconds                                                                                                                                                                                                                          
      memory              226.28k                                                                                                                                                                                                                               
      OS Memory           18936.00k                                                                                                                                                                                                                             
      Timestamp           06/17/2016 06:03:21 PM                                                                                                                                                                                                                
      Step Count                        134  Switch Count  0                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                
712 !      quit;                                                                                                                                                                                                                                                
713   proc cimport data=classcpt file="d:/cpt/class.cpt";                                                                                                                                                                                                       
714   ;run;                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                
NOTE: PROC CIMPORT begins to create/update data set WORK.classcpt                                                                                                                                                                                               
NOTE: Data set contains 5 variables and 19 observations.                                                                                                                                                                                                        
      Logical record length is 40                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                
NOTE: PROCEDURE CIMPORT used (Total process time):                                                                                                                                                                                                              
      real time           0.01 seconds                                                                                                                                                                                                                          
      user cpu time       0.01 seconds                                                                                                                                                                                                                          
      system cpu time     0.00 seconds                                                                                                                                                                                                                          
      memory              321.46k                                                                                                                                                                                                                               
      OS Memory           19196.00k                                                                                                                                                                                                                             
      Timestamp           06/17/2016 06:03:21 PM                                                                                                                                                                                                                
      Step Count                        135  Switch Count  0                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                
714 !      quit;                                                                                                                                                                                                                                                
                                          &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2016 22:34:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-xpt2loc-to-convert-Xport-file-generated-by-V8-machine/m-p/278324#M269668</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2016-06-17T22:34:20Z</dc:date>
    </item>
  </channel>
</rss>

