I am trying to read a text file using "infile" statement, where data can come in either of delimiters - comma or tilda.
We have only SAS 8.2 Version. I saw that this option in infile statement - DLMSTR has facility to read either of ways that data will come and is applicable in SAS 9 version.
Do we have an equivalent option in SAS 8.2 Version. If not, how to read data if the file comes in either of those above delimiters?
the DLM='constant' option of the infile statement lists alternative delimiters all/any of which are used to parse the infile buffer
When you need to use different delimiters at different stages of input, use DLM=variable. The variable can change during the running of the data step in ways that the 'constant' cannot.
peterC
emphasise that characters in the DLM are alternatives
...
> I saw that this option
> in infile statement - DLMSTR has facility to read
> either of ways that data will come and is applicable
> in SAS 9 version.
...
No. DLMSTR= option lets you specify a multi-character delimiter. DLM= option lets you specify single-character delimiter(s). A rather big difference.
[pre]
data one;
infile cards dlmstr="+|+" missover;
input (v1-v3) (:$8.);
cards;
1+++|+2||++|+3
;
run;