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
Diamond | Level 26
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 834 views
  • 0 likes
  • 2 in conversation