05-12-2016 01:51 PM - edited 05-12-2016 01:54 PM
I am faicng an issue while reading Pipe delimeted file. there is a single quotes in between two field due to which its getting clubed together in one field.
123456789|'|9820 SW 120TH ST| |
123456789 |9820 SW 120TH ST| |
i am using below code
LENGTH ACCOUNT $16. addr_1 $30. addr_2 $30. addr_3 $30. addr_4 $30. ;
INFILE "/filelocation/test.txt" DSD DLM='|' ;
INPUT ACCOUNT addr_1 addr_2 addr_3 addr_4 .$ ;
Highlighted one getting combined into one.
can anyone please suggest me how to handle it. and I am not sure which row and column can have this value.
05-12-2016 02:33 PM
In your output data set, which variable should hold the value:
9820 SW 120TH ST
Would it make a difference if this variable were shifted over, and became the value of ADDR_1?
Would single quotes ever appear anywhere else within your data, other than in the characters |'| ?
05-12-2016 03:46 PM
I cannot replicate your issue:
DATA NEW; LENGTH ACCOUNT $16 addr_1 $30 addr_2 $30 addr_3 $30 addr_4 $30; INFILE cards DSD DLM='|' ; INPUT ACCOUNT addr_1 addr_2 addr_3 addr_4; cards; 123456789|'|9820 SW 120TH ST| | ;
ACCOUNT addr_1 addr_2 addr_3 addr_4 123456789 ' 9820 SW 120TH ST
(Same result when reading from an external file.)