RE: Altair slc separate invoices for a mailing list and adressing tools
Too long to post in a listserv, see github for complete solution
github
https://github.com/rogerjdeangelis/utl-altair-slc-separate-invoices-for-a-mailing-list-and-adressing-tools
CONTENTS
1 Split invoices into separate files
2 Tools for mailing lists and geocoding,
OPS PROBLEM
I have a file with 1000 statements that need to be separated in order to be printed and mailed.
Normally, this would be handled by an outside mailing provider,
but we no longer have access to that resource. I have been asked
to see if I can accomplish this task. Reaching out to my colleagues for
discussion regarding, if this is something that can be handled by Data Prep and what
would the concept look like. I have attached 3 of the statements as it appears in the file.
My interpretaion
If you just want to separate the invoices in separate files.
Note it is easy to standardize and verify the home or business address exists.
However the occupants name is not availbale in any of my databases,
You have to use 'Current Resident' in the mailpeice.
I do have every address in the US , 141 million addresses, you can check against.
THIS CODE WILL SPLIT THE INVOICES INTO 1000 FILES
data null;
length fname $32;
retain fyl 0 fname;
infile "d:/txt/invoices.txt";
input;
if index(infile,'Page:') then do;
fyl=fyl+1;
fname = cats("d:/txt/file", put(fyl, 8.), ".txt");
file dummy filevar=fname;
put infile;
end;
else do;
fname = cats("d:/txt/file", put(fyl, 8.), ".txt");
file dummy filevar=fname;
put infile;
* putlog infile;
end;
run;quit;