Hello. I am trying to read in pipe delimited data that has multiple record layouts. I have tried several methods that get me close but with no success. There are 3 issues I am encountering with the data (1) There are no end-of-record pipes (2) The first field will determing the remaining record layouts (3) I do not have position information for the fields, they are only seperated by "|". Below is the first method I have tried in SAS 9.4 Method 1: data want; infile indata dlm='|' firstobs=1; input @1 rec_type $2.; if rec_type='RA'; input rec_type $2. var2 $2 ; run; Method 2: data want ; %let _EFIERR_ = 0; /* set the ERROR detection macro variable */ infile indata delimiter = '|' DSD lrecl=32767 ; informat rec_type $2.; input rec_type $; if rec_type='RA' then do; informat var2 $2.; format var2 ; end; run; My problem is trying to address the changing record layout and telling says where the end of the record is. Attached is a sample of the data file I am working with.
... View more