Input Statement for Text File - SAS not recognizing delimiter

Reply
Occasional Contributor
Posts: 15

Input Statement for Text File - SAS not recognizing delimiter

Given the following code, my First name and last name are showing up within the same variable (as well as the entire address) -- how do I modify the program to separate them? On the txt file the information reads:

APPLICANT INFORMATION
Name / Current AddressPhoneSSNDOBMarital Status
Jane    Doe   XXX-XX-XXXX 05/23/1991
        1539  W. PENNY STREET   PORTLAND   MD   15211

I have the following code:

data test;

infile ".....filepath....." dlm="09"x dsd;

input type  $ @;

if index (type, "ONE") then do;

  length

  Firstname :$30 Lastname :$30 SSN :$20 Address :$100

  City :$30 State :$3 Zip :$10 ;

  informat

  Firstname :$20. Lastname :$30. SSN :$20. Address :$100.

  City :$30. State :$3. Zip :$10. ;

  input

  @ "Name / Current Address" / FirstName : $30. LastName : $30. SSN : $20.

   / Address : $100. City : $30. State : $3. Zip : $10. ;

  put  FirstName LastName SSN Address City State Zip ;

output;

end;

run;

SAS Super FREQ
Posts: 683

Re: Input Statement for Text File - SAS not recognizing delimiter

Please provide a sample of the data in a ZIP file, as copy/paste into a message will scramble up the contents and it is difficult to see what the file looks like.

Ask a Question
Discussion stats
  • 1 reply
  • 201 views
  • 0 likes
  • 2 in conversation