Hello - I am coding (from scratch) a parsing program that will extract health care claims data from the ANSI ASC X12N 837 Health Care Claims (837) transaction layout. Due to the program complexity, I've been searching for a sample SAS program that has done this before - but haven't found one yet. Does anyone have any suggestions about where I could locate such a program?
The PDF that describes your record layout does say that it is a hierarchical file and refers to the possible repetition of records as "LOOPS". It is possible to read a hierarchical file with SAS. However, to do it will involve an advanced use of the INPUT statement and possibly include the use of the trailing @ sign to hold each record for further parsing after you make the decision (with an IF statement) about what the record format is. You may also need to use the RETAIN statement to retain or keep information from different records in the hierarchy, because information found on a higher level record is not repeated on a lower level record (according to the PDF).
Tech Support DOES have a sample of reading a simple hierarchical file. Their program creates a little sample file with a few record types as step 1 and then their Step 2 program parses the hierarchical file. The URL for the sample program is here: http://support.sas.com/ctx/samples/index.jsp?sid=96&tab=about
If you still feel that you need help with the syntax, after reviewing the sample, your best bet with this kind of problem is to contact Tech Support. It will be easier for them to help you with the program if you can provide a sample of what the data -actually- looks like. Here's the link with the ways to contact Tech Support. http://support.sas.com/techsup/contact/index.html