SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Having problem with numeric values in xpt files

Accepted Solution Solved
Reply
Contributor
Posts: 29
Accepted Solution

Having problem with numeric values in xpt files


I am converting sas dataset to sas XPT files. The numeric missing data in the Xpt file is showing as 'blank' where as in dataset it is showing as '.' i.e. period. How can i get the '.' representation in XPT as well.


Accepted Solutions
Solution
‎12-09-2014 06:53 AM
Super User
Super User
Posts: 7,977

Re: Having problem with numeric values in xpt files

So there is your answer then.  XPT file format does not hold '.'s as missing values, this is determined by your SAS system options when you open a dataset.  XPT is used for transporting datasets from one system to another, then once the data is there it is viewed in SAS using its options setup.

SAS Viewer doesn't have the options setup, so it just reads the file as is and displays it - i.e. it doesn't do the extra step of displaying blanks as .

To clarify above (was blathering a bit as lunch time):

SAS adds a layer of masking to the data based on your options setup, much like applying a format, SAS Viewer doesn't have that so you see the actual stored information.

View solution in original post


All Replies
Super User
Super User
Posts: 7,977

Re: Having problem with numeric values in xpt files

Well, I haven't tested this, but from memory the XPT file format is a transport file format.  I.e. it stores the data for sending elsewhere.  That data is then upacked into the recipients system using the SAS system options.  So you see the dataset in your system which has:

options missing='.';

So, how are you viewing the XPT, is it by opening it in SAS, or opening in SAS viewer, or actually proc copy'ing the dataset.  I would suggest copying it back into your system and seeing what the copied dataset looks like.

Contributor
Posts: 29

Re: Having problem with numeric values in xpt files

I am using sas viewer to open xpt file and i have used proc copy to create the xpt file. As you suggested i have copied back the xpt file to dataset and it looks fine numeric missing values are represented as '.'

Solution
‎12-09-2014 06:53 AM
Super User
Super User
Posts: 7,977

Re: Having problem with numeric values in xpt files

So there is your answer then.  XPT file format does not hold '.'s as missing values, this is determined by your SAS system options when you open a dataset.  XPT is used for transporting datasets from one system to another, then once the data is there it is viewed in SAS using its options setup.

SAS Viewer doesn't have the options setup, so it just reads the file as is and displays it - i.e. it doesn't do the extra step of displaying blanks as .

To clarify above (was blathering a bit as lunch time):

SAS adds a layer of masking to the data based on your options setup, much like applying a format, SAS Viewer doesn't have that so you see the actual stored information.

Contributor
Posts: 29

Re: Having problem with numeric values in xpt files

Thanks for the help Smiley Happy

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 370 views
  • 5 likes
  • 2 in conversation