BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tom
Super User Tom
Super User

Hard to tell without being able to see the data or the data definition documents that you used to create the program to read it.  The litte bit of SAS code you posted makes it look like you are treating the source file as if each field is in a fixed place on the data line.

 

One thing that can make that type of input statement fail is if the file was edited with a program that replaces the spaces with tabs.  You migth try adding EXPANDTABS option to the INFILE statement.

 

Where did the source file come from?  It is possible that the problem was actually introduced in the program that generated the file.  Especially since you stated that you are changing from a system that only used ICD-9 codes to one that includes ICD-10 codes. Perhaps when they added support for ICD-10 they did not take into account that the ICD-10 code values might require more characters than the older ICD-9 codes.  This could cause all of your hardcoded @ pointer controls to get out of alignment with the data.  That is why I suggested using the LIST command to look at the data. That will display the lines with column numbers so you can confirm that the values are why you expected them to be on the line.

 

Bal23
Lapis Lazuli | Level 10

They are very good points. thanks

Reeza
Super User

Take your text file and get a subset, 100 or 1000 records. 

 

Paste it into Excel, and use text to columns. Manually separate out your variables. Compare to SAS output. 

 

This is painstaking but it's probably faster than all this back and forth has taken. 

Bal23
Lapis Lazuli | Level 10

 

I have tried almost all infile options but i might forget some other options, if it has some

thanks

Reeza
Super User

Its a text file. If it's only 13000 rows open it in notepad or wordpad to view it. Right click, Open with, select a program and pick one. If you have notepad++ use that. 

Bal23
Lapis Lazuli | Level 10

Thanks. It said it was too large to open it with notepad

 

any infile options you can remind me? Thanks.

Bal23
Lapis Lazuli | Level 10

I tried expandtab. it does not work

I was told there was no delimiter

the only problem is irecl setting. why it is 20k

any infile option to change

Reeza
Super User

LRECL changes the length read in. 

Did you try the powershell script to extract a few lines of the file and then try opening the output file?

 

Bal23
Lapis Lazuli | Level 10

yes i used tom's code

 

Reeza
Super User

Then change LRECL To 20k. 

 

This is really should have nothing to do with your issues reading your file though. If the LRECL is longer and you have TRUNCOVER specified it will ignore the remaining chars. Also your using column input so it should be the issue either. 

 

If you'be managed to extract th file have you tried the Excel method I suggested to review your data?

 

 

Reeza
Super User

Use SAS or powershell to extract a smaller sunset into a text file and examine this in Excel. 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 41 replies
  • 1760 views
  • 3 likes
  • 5 in conversation