BookmarkSubscribeRSS Feed
deleted_user
Not applicable
When reading in a flat file, with non-standard informats for packed and signed variables, it is not "straightforward" to retrieve the actual position in the flat file from which a certain variable is read. Is it possible to retrieve those positions, or save them, after reading in the data in SAS?
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
Generally, if you are reading packed and/or signed data, it is possible (sometimes) to get the program that created the file...or get the program that reads the file. For example, if you have a COBOL copybook or COBOL file description, there is a program called COB2SAS that will "translate" a COBOL file description to a SAS INPUT statement.
http://support.sas.com/techsup/technote/ts620.html
http://support.sas.com/techsup/technote/ts536.html

Otherwise, it -is- possible to figure out the position -- not easy, but possible. It requires counting bytes and looking at a hexadecimal version of the input file. This section in the documentation has some useful information:
http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a001239773.htm
http://support.sas.com/techsup/technote/ts642.html
http://support.sas.com/kb/16/565.html
http://support.sas.com/techsup/technote/ts654.pdf

If you have ongoing issues reading your data, you may wish to contact Tech Support for more in-depth help. They would really need to look at your data to advise you on how to read it.

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 589 views
  • 0 likes
  • 2 in conversation