Hi, I'm importing data (I've set up a macro to import all files from a certain location) using infile. There is 1 troublesome variable - "Life Assured Name" which very occasionally also has a comma in it. For example "Mary Jane, Amy" which I need to be read into 1 cell but all of the data shifts along as the comma is set as my delimeter. In the csv file the data does not contain quotation marks, only commas. Here is my code: DATA dsn&cnt;
LENGTH
'Promotion Code'n 8
'Promotion Name'n $ 35
'Plan Name'n $ 3
'Commission Rate'n 8
Channel $ 1
'Policy Number'n 8
'Life Assured Name'n $ 45
'Life Assured DoB'n 8
'Effective Date of Assurance'n 8
Premium 8
'Initial Commission'n 8
Clawback 8
'Renewal Commission'n 8
'Total Commission'n 8
'Effective Date'n 8
'Third Party Reference'n 8
'Settlement Reference'n $ 26
FNAME $200.;
FORMAT
'Promotion Code'n BEST5.
'Promotion Name'n $CHAR35.
'Plan Name'n $CHAR3.
'Commission Rate'n BEST3.
Channel $CHAR1.
'Policy Number'n BEST7.
'Life Assured Name'n $CHAR45.
'Life Assured DoB'n DDMMYY10.
'Effective Date of Assurance'n DDMMYY10.
Premium BEST5.
'Initial Commission'n BEST8.
Clawback BEST8.
'Renewal Commission'n BEST5.
'Total Commission'n BEST8.
'Effective Date'n DDMMYY10.
'Third Party Reference'n BEST6.
'Settlement Reference'n $CHAR26.;
INFORMAT
'Promotion Code'n BEST5.
'Promotion Name'n $CHAR35.
'Plan Name'n $CHAR3.
'Commission Rate'n BEST3.
Channel $CHAR1.
'Policy Number'n BEST7.
'Life Assured Name'n $CHAR45.
'Life Assured DoB'n DDMMYY10.
'Effective Date of Assurance'n DDMMYY10.
Premium BEST5.
'Initial Commission'n BEST8.
Clawback BEST8.
'Renewal Commission'n BEST5.
'Total Commission'n BEST8.
'Effective Date'n DDMMYY10.
'Third Party Reference'n BEST6.
'Settlement Reference'n $CHAR26.;
INFILE "&dir\%qsysfunc(dread(&did,&i))"
LRECL=32767
FIRSTOBS=6
ENCODING="WLATIN1"
DLM='2c'x
MISSOVER
DSD
filename=fname;
INPUT
'Promotion Code'n : ?? BEST5.
'Promotion Name'n : $CHAR35.
'Plan Name'n : $CHAR3.
'Commission Rate'n : ?? BEST3.
Channel : $CHAR1.
'Policy Number'n : ?? BEST7.
'Life Assured Name'n : $CHAR45.
'Life Assured DoB'n : ?? DDMMYY10.
'Effective Date of Assurance'n : ?? DDMMYY10.
Premium : ?? COMMA5.
'Initial Commission'n : ?? COMMA7.
Clawback : ?? COMMA6.
'Renewal Commission'n : BEST5.
'Total Commission'n : ?? COMMA7.
'Effective Date'n : ?? DDMMYY10.
'Third Party Reference'n : BEST6.
'Settlement Reference'n : $CHAR25.;
Filename = Fname;
File = &cnt;
ordering = _n_;
run; I've tried using termstr with no luck, I'm not sure how to solve this. Any help would be great. Thansk, Liz
... View more