I am writing a program that gets IDs from a database then outputs them in files 900 at a time. The IDs need to be surrounded by apostrophes and comma separated. The list needs to start with an open parentheses and end with a closed parentheses in each of 3 files. For example: FileA.txt ('11111', '22222', '33333') FileB.txt ('44444', '55555', '66666') Here is my attempt at doing this, but I am a beginner and am sure this is not the best way. And cannot figure out how to get rid of the final comma. %Let taxlength=900; data _null_; file out1; put @1 "("; file out2; put @1 "("; file out3; put @1 "("; run; data _null_; set v_id; if _n_ <= &taxlength then file out1 mod notitles ; if 901 <= _n_ <= (&taxlength*2) then file out2 mod notitles ; if 1801 <= _n_ <= (&taxlength*3) then file out3 mod notitles ; vendorid=vendorid; put @1 "'" @2 vendorid 10. @12 "'" @13 ","; run; data _null_; file out1 mod; put @1 ")"; file out2 mod; put @1 ")"; file out3 mod; put @1 ")"; run;
... View more