Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Reading An Input Records Backwards

Reading An Input Records Backwards

Reading An Input Records Backwards

Hello everyone ...

I need some assistance in determining how to read input record.  Normally, I just start at a specific position and begin reading in until the end of the value.  However, I've come across a flat file that has some unique characteristics and am hoping someone can suggest something as this is above my skill level.

Here is a sample of my data.  I have enabled hex as the data is packed signed and unsigned:


3..... .l......  .

When my record type is 3, my record identifier (packed unsigned) will be stored in bytes 2 through 15.  However, the record identifier is variable length and aligned on the right.  The length of the record identifier is stored in bytes 18 and 19 and is packed signed.

In the sample above here is the data:

Record length = 18
Record identifier = 801894200004652635

I have no experience with reading values backwards.  Can SAS do this?  If so, I have no idea how to code this.  My normal programs are simple, like:


OPTIONS NOSOURCE;                 
INFILE INPUT1;                    
FILE OUTPUT1;                     
INPUT @01 RECTYP $CHAR1. @ ;      
  IF RECTYP = '3' THEN            
      INPUT @02  CUSTOMER $CHAR19.
            @30  ADDRESS  $CHAR30.  
            @133 CITY     $CHAR30.
            @150 DESCRIP  $CHAR30.;

Does anyone have any suggestions or guidance that can help me?

Thank you in advance!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close