Hi, In my new role, I need to do a lot of inputting flat files pulled from the mainframe. I am having a hard time writing input statements for these, that work in a consistent way. Clearly I am not fully understanding how to do this. For example, if I have data in a .txt file that looks like CLCODE;AGENT *;50002 *;50002 ;50002 *;50002 *;50002 Call it test.txt. I try the input step - data test; infile test DLM=';' FIRSTOBS=2 LRECL=350 MISSOVER; input CLCODE $1. AGENT $5.; run; I do not get the expected result. It ignores the delimiter, and instead treats it as part of the string. So when I have a *, I wind up with clcode = * and agent = ;5000. When I do not have a *, I wind up with clcode = ; and agent = 50002. Why will it not work to simply use the DLM as the separator and import each field in the designated informat? Even excel can very quickly and correctly open the test.txt file, with only knowing the delimiter. SAS knows the delimiter and more information and cannot seem to import it correctly. Thanks for any help, I'm sure I'm missing something basic, but as I said, I have not done a lot of importing flat files in my past life.
... View more