I have a tab delimited flat file that periodically contains structure shifts due to limitations of the software it is exported from. Example lines are below. The last line of the example data shows the problem. When data is missing (outside of the "header" columns), there is not a carriage return to go the next line. The next line just begins where the previous left off.
Name Code Hr Bid Department Called-In Abs Dept Seniority 27-JAN-2020 1 12-OCT-2019 / 2 8.000 A SMITH, JOHN P (999999) MECHANICAL [2] MECHANICAL [2]
Name Code Hr Bid Department Called-In Abs Dept Seniority 29-JAN-2020 2 05-MAY-2018 / 2 8.000 A SMITH, JOHN R (999999) EMPLOYEE RELATIONS [3] PROCESSING [3]
Name Code Hr Bid Department Called-In Abs Dept Seniority 21-JAN-2020 3 13-JUN-2009 / 6 8.000 A SMITH, JOHN J (999999) MECHANICAL [3] MECHANICAL [3]
Name Code Hr Bid Department Called-In Abs Dept Seniority 20-JAN-2020 4 07-DEC-2006 / 2 8.000 A SMITH, JOHN O (999999) MECHANICAL [2] MECHANICAL [2]
Name Code Hr Bid Department Called-In Abs Dept Seniority 19-JAN-2020 5 24-MAR-2001 / 8 8.000 A SMITH, JOHN C (999999) PROCESSING [3] PROCESSING [3]
Name Code Hr Bid Department Called-In Abs Dept Seniority 30-JAN-2020 6 03-NOV-2002 / 4 8.000 A SMITH, JOHN G (999999) MECHANICAL [2] MECHANICAL [2]
Name Code Hr Bid Department Called-In Abs Dept Seniority 10-FEB-2020 Name Code Hr Bid Department Called-In Abs Dept Seniority 11-FEB-2020 1 22-NOV-2001 / 8 8.000 A SMITH, JOHN S (999999) PACKING [2] PACKING [2]
I would like to be able to handle these situations within the infile read, but I have not been able to consistently / sustainably capture the issue. I am hoping there is a way detect that the current infile line is longer than expected, and thus "move" SAS to the next observation, e.g. the final SAS table should look like..
Name Code Hr Bid Department Called-In Abs Dept Seniority 27-JAN-2020 1 12-OCT-2019 / 2 8.000 A SMITH, JOHN P (999999) MECHANICAL [2] MECHANICAL [2]
Name Code Hr Bid Department Called-In Abs Dept Seniority 29-JAN-2020 2 05-MAY-2018 / 2 8.000 A SMITH, JOHN R (999999) EMPLOYEE RELATIONS [3] PROCESSING [3]
Name Code Hr Bid Department Called-In Abs Dept Seniority 21-JAN-2020 3 13-JUN-2009 / 6 8.000 A SMITH, JOHN J (999999) MECHANICAL [3] MECHANICAL [3]
Name Code Hr Bid Department Called-In Abs Dept Seniority 20-JAN-2020 4 07-DEC-2006 / 2 8.000 A SMITH, JOHN O (999999) MECHANICAL [2] MECHANICAL [2]
Name Code Hr Bid Department Called-In Abs Dept Seniority 19-JAN-2020 5 24-MAR-2001 / 8 8.000 A SMITH, JOHN C (999999) PROCESSING [3] PROCESSING [3]
Name Code Hr Bid Department Called-In Abs Dept Seniority 30-JAN-2020 6 03-NOV-2002 / 4 8.000 A SMITH, JOHN G (999999) MECHANICAL [2] MECHANICAL [2]
Name Code Hr Bid Department Called-In Abs Dept Seniority 10-FEB-2020
Name Code Hr Bid Department Called-In Abs Dept Seniority 11-FEB-2020 1 22-NOV-2001 / 8 8.000 A SMITH, JOHN S (999999) PACKING [2] PACKING [2]
I've tried combinations of missover / truncover / flowover, as well as _infile_ variable, but I can't seem to get the pointer to move along to the next SAS observation while still within 1 row of the input file.
... View more