BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Bal23
Lapis Lazuli | Level 10

I need to dvelop a code to read a dataste that contains both icd-9 and 10 codes. Any reference for me to read?

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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

 

View solution in original post

41 REPLIES 41
Reeza
Super User

You should be reading and storing both ICD9 and ICD10 as character fields so you need to change the length of the field possibly but besides that there should be no issue.

Reeza
Super User

Without seeing anything else ... no.

 

Post your code, log and sample data.

 

Check your input statement - is it missover truncover flowover? Which is appropriate for your situation?

Norman21
Lapis Lazuli | Level 10

This article contains information on the Lost Card note.

 

http://www2.sas.com/proceedings/sugi30/058-30.pdf

Norman.
SAS 9.4 (TS1M6) X64_10PRO WIN 10.0.17763 Workstation

Cynthia_sas
SAS Super FREQ
Hi:
Here is a paper from 2016 that discusses a SAS macro program (presumably written by the paper authors) on dealing with a file that had both ICD-9 and ICD-10 data:
https://www.nahdo.org/sites/nahdo.org/files/Resources/Other_Resources/CDC_webinar_SASmacro_Dualcoded...

You might want to investigate whether the paper authors will share their programs. There is a contact email at the end of the paper.

cynthia
Bal23
Lapis Lazuli | Level 10

Thanks. I have read this before.

 

truncover

 

 

I added truncover option. No more "loss card" but still almost all missing data, execpt  the first  2-7 variavles, the first one is also blank

Should I change Irecl?

 

 

 

The log shows The minimum record length was 256.

 

 

Bal23
Lapis Lazuli | Level 10

I also added firstobs=2 because I only want to test it, without waiting for it to finish the whole records,

it still reads all records

can anyone tell how to fix it

 

Bal23
Lapis Lazuli | Level 10

missover truncover obs=2;

I did use this and it only read two records, but most info was missing except the first 2-7 variables

most missing data, what should I do

Bal23
Lapis Lazuli | Level 10

I chaged the

lrecl to the maximum value but now it only reads most variables but still many values are missing. Any suggestions.

 

Reeza
Super User

Guessing is a waste of everyone's time. 


Post your code, log and sample data.

Reeza
Super User

20k is the length of the record. Your last input variable starts well before that so that's why your missing variables. 

 

Use truncover. 

Fix your input statement. 

This all assumes you have a fixed width file. 

 

Use the following to subset your file so you can debug it. Extract 20 lines and make sure your input statement is correct. 

https://gist.github.com/statgeek/de01cb34a61e53f2915d

Bal23
Lapis Lazuli | Level 10

Thanks.

I have used truncover, it does not change.

I cannot open the link. doe it need to register?

I cannot understand how to fix it.  I still do not understand why it is "20,000"   and do not understand "Your last input variable starts well before that so that's why your missing variables"

Reeza
Super User

SAS is saying a record length is 20,000 characters/columns. You've set it to the 32K characters but that doesn't matter if there's nothing beyond this. 

 

Your last input variable starts at column 13456.  I'm assuming you have a specification document, what does that say regarding length and variables? 

 

The code was for Powershell, a script command to extract top N lines.

 

gc -path file_name.csv - head N > output.txt

 

 

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
  • 1754 views
  • 3 likes
  • 5 in conversation