DATA Step, Macro, Functions and more

how to read a dataset that contains both icd-9 and icd 10 code

Accepted Solution Solved
Reply
Super Contributor
Posts: 345
Accepted Solution

how to read a dataset that contains both icd-9 and icd 10 code

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


Accepted Solutions
Solution
‎06-30-2016 03:50 PM
Super User
Posts: 19,770

Re: how to read a dataset that contains both icd-9 and icd 10 code

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

 

View solution in original post


All Replies
Super User
Posts: 19,770

Re: how to read a dataset that contains both icd-9 and icd 10 code

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.

Super Contributor
Posts: 345

Re: how to read a dataset that contains both icd-9 and icd 10 code

[ Edited ]
 
Super User
Posts: 19,770

Re: how to read a dataset that contains both icd-9 and icd 10 code

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?

Frequent Contributor
Posts: 95

Re: how to read a dataset that contains both icd-9 and icd 10 code

This article contains information on the Lost Card note.

 

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

Norman.
SAS 9.4 (TS1M4) X64_7PRO WIN 6.1.7601 Service Pack 1 Workstation

SAS Super FREQ
Posts: 8,862

Re: how to read a dataset that contains both icd-9 and icd 10 code

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
Super Contributor
Posts: 345

Re: how to read a dataset that contains both icd-9 and icd 10 code

Posted in reply to Cynthia_sas

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.

 

 

Super Contributor
Posts: 345

Re: how to read a dataset that contains both icd-9 and icd 10 code

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

 

Super Contributor
Posts: 345

Re: how to read a dataset that contains both icd-9 and icd 10 code

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

Super Contributor
Posts: 345

Re: how to read a dataset that contains both icd-9 and icd 10 code

I chaged the

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

 

Super User
Posts: 19,770

Re: how to read a dataset that contains both icd-9 and icd 10 code

Guessing is a waste of everyone's time. 


Post your code, log and sample data.

Super Contributor
Posts: 345

Re: how to read a dataset that contains both icd-9 and icd 10 code

[ Edited ]
run;

 

Super User
Posts: 19,770

Re: how to read a dataset that contains both icd-9 and icd 10 code

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

Super Contributor
Posts: 345

Re: how to read a dataset that contains both icd-9 and icd 10 code

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"

Super User
Posts: 19,770

Re: how to read a dataset that contains both icd-9 and icd 10 code

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

 

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 41 replies
  • 475 views
  • 3 likes
  • 5 in conversation