I have to read a raw data file which has multiple rows. Each row has different data and identified by first 5 characters. Each row has to be parsed and stored to SAS Dataset.
For eample one row is as below:
03ABW123456789Firstname MA lastname JR 111111111125 Y23456789019850121emailid@email.com
The first 5 characters are the segment Identifier is "03ABW".
Next 9 digits are SSN.
Next 35 chars are First Name
Next 35 chars are Middle Name
Next 35 chars are Last Name
Next 4 chars are Generation
And so on..
For creating the data set with the following fileds
SSN $9
First Name $35
Middle Name $35
Last Name $35
...
I am using the following
DATA NAME
INFILE '/home/xxx/NAME.txt';
INPUT @'03ABW' Applicant_SSN $9
+1 APP_FIRST_NAME $35 ;
I am using the segment ID '03ABW' to go the correct row.
1) How do I go to different rows in the raw data file ?
2) How do I to the adjacent columns in a row to get the SSN/Names etc.
3) How do I move by a specified displacement and get that data from INPUT statement to populate in the dataset fields?
Message was edited by: MR