BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
KevinViel
Pyrite | Level 9

Can anyone explain this issue?

 

558 libname sas "D:\sastemp\_TD25684_PGHSAS1_" ;

NOTE: Libref SAS refers to the same physical library as WORK.

NOTE: Libref SAS was successfully assigned as follows:

Engine: V9

Physical Name: D:\sastemp\_TD25684_PGHSAS1_

559

560 libname xpt xport "M:\3 - SDTM\Exports_04142017\AE.xpt" ;

NOTE: Libref XPT was successfully assigned as follows:

Engine: XPORT

Physical Name: M:\3 - SDTM\Exports_04142017\AE.xpt

561

562 proc copy in = xpt out = sas memtype = data ;

563 select AE ;

564 run ;

NOTE: Input library XPT is sequential.

ERROR: File XPT.ALL. is not a SAS data set.

NOTE: Statements not processed because of errors noted above.

NOTE: PROCEDURE COPY used (Total process time):

real time 0.00 seconds

cpu time 0.00 seconds

NOTE: The SAS System stopped processing this step because of errors.

 

 

Note the transport file is named AE.XPT.  The only hint that I am getting from the user is the she exported from Omnicomm and set the version to V8.

 

Thank you,

 

Kevin

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Looks like they made the XPT file using the %LOC2XPT() macro instead of using the XPORT libname engine.

So you need to use the %XPT2LOC() macro to convert it back into a dataset.

%*-------------------------------------------------------------------*;
%* The xpt2loc macro is used to convert a transport file into local  *;
%* SAS data set representation. The parameters are:                  *;
%*                                                                   *;
%* libref=          indicates the libref where the members will be   *;
%*                  written. The default is WORK.                    *;
%* memlist=         indicates the list of members in the library     *;
%*                  that are to be converted. The default is that    *;
%*                  all members will be converted.                   *;
%* filespec=        gives a fileref (unquoted) or a file path        *;
%*                  (quoted) where the transport file resides        *;
%*                  written. There is no default.                    *;
%*                                                                   *;
%* This macro should be able to handle V5 transport files written by *;
%* the XPORT engine. It should also handle V8 extended transport     *;
%* files written by the companion loc2xpt macro.                     *;
%*-------------------------------------------------------------------*;

So try something like this:

%xpt2loc(filespec="M:\3 - SDTM\Exports_04142017\AE.xpt") ;

View solution in original post

7 REPLIES 7
Tom
Super User Tom
Super User

Check the file.  There are two types of transport files. The SAS V5 transport files that the XPORT libname engine can read. There are also files generated by PROC CPORT that you need to read using PROC CIMPORT.  If you look at the first line of the file you can see the difference.

XPORT files will look like

RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+---
1         HEADER RECORD*******LIBRARY HEADER RECORD!!!!!!!000000000000000000000000000000

CPORT files will look like

RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+---
1         **COMPRESSED** **COMPRESSED** **COMPRESSED** **COMPRESSED** **COMPRESSED********

Also note that if you have moved the files using FTP and FTP teated them as text files instead of binary files they can become corrupted.

KevinViel
Pyrite | Level 9

HEADER RECORD*******LIBV8   HEADER RECORD!!!!!!!000000000000000000000000000000  SAS     SAS     SASLIB  9.1     WIN

 

HEADER RECORD*******LIBRARY HEADER RECORD!!!!!!!000000000000000000000000000000  SAS     SAS     SASLIB  9.4     X64_S08R

 

The top line is from the culprit XPT file.  The bottom is from our usual version.

 

Thank you,

 

Kevin

KevinViel
Pyrite | Level 9

http://support.sas.com/kb/46/944.html

 

The XPORT engine is restricted to reading the older V5 transport files. Revisions to XPT2LOC.SAS and XPTCOMMN.SAS macros in this Download tab, and in releases after SAS 9.4ts1m3 within the autocall library, allow V5/V6 transport files created with %LOC2XPT to be converted using PROC COPY and the XPORT engine. However, if you try to read a V8/V9 transport file using PROC COPY and the XPORT engine, you will get an error in the log. The macro XPT2LOC reads both the older V5 transport files and the new V8/V9 transport file format.

KevinViel
Pyrite | Level 9

1818  %xpt2loc
1819     ( libref   = work
1820     , memlist  = _all_
1821     , filespec = 'M:\Data Management\3 - SDTM\Exports_04142017\ae.xpt'
1822     ) ;

 

<SNIPPED>

 

NOTE: UNBUFFERED is the default with RECFM=N.
NOTE: The infile 'M:\Data Management\\3 - SDTM\Exports_04142017\ae.xpt' is:
      Filename=M:\Data Management\\3 - SDTM\Exports_04142017\ae.xpt,
      RECFM=N,LRECL=32767,File Size (bytes)=18400,
      Last Modified=14Apr2017:13:29:20,
      Create Time=14Apr2017:13:34:02

NOTE: Unexpected end of file for binary input.
NOTE: The data set WORK.AE has 3 observations and 41 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds


NOTE: Fileref SASCODE has been deassigned.

Tom
Super User Tom
Super User

Sounds like you have a corrupt file.  The problem is that auto transfer modes can get confused becuase the beginning of the file looks like normal ASCII text, but the format is BINARY and should be transferred as such.

 

Tom
Super User Tom
Super User

Looks like they made the XPT file using the %LOC2XPT() macro instead of using the XPORT libname engine.

So you need to use the %XPT2LOC() macro to convert it back into a dataset.

%*-------------------------------------------------------------------*;
%* The xpt2loc macro is used to convert a transport file into local  *;
%* SAS data set representation. The parameters are:                  *;
%*                                                                   *;
%* libref=          indicates the libref where the members will be   *;
%*                  written. The default is WORK.                    *;
%* memlist=         indicates the list of members in the library     *;
%*                  that are to be converted. The default is that    *;
%*                  all members will be converted.                   *;
%* filespec=        gives a fileref (unquoted) or a file path        *;
%*                  (quoted) where the transport file resides        *;
%*                  written. There is no default.                    *;
%*                                                                   *;
%* This macro should be able to handle V5 transport files written by *;
%* the XPORT engine. It should also handle V8 extended transport     *;
%* files written by the companion loc2xpt macro.                     *;
%*-------------------------------------------------------------------*;

So try something like this:

%xpt2loc(filespec="M:\3 - SDTM\Exports_04142017\AE.xpt") ;
KevinViel
Pyrite | Level 9

Tom,

 

  That is correct.  Sorry if I double posted.  I now have a working solution for the future.

 

 

Thank you,

 

Kevin

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 7665 views
  • 2 likes
  • 2 in conversation