x cd /pub/data/pl942000/Tools; %let pgm=list1obs; filename pgm "&pgm..sas"; *--You can delete this line-; /*--Read the 2 ".upl" files with data from a PL set of files. Generate a listing all items in the first (state summary) record. Debugging aid. */ filename in1 "/pub/data/pl942000/ks00001.upl"; filename in2 "/pub/data/pl942000/ks00002.upl"; libname user '/tmp/user'; data pl941obs; infile in1 lrecl=1024 obs=1 missover dsd; *<---------------Read input file 1----------------; input _first14 $char14. recid 7. +1 PL1i1-PL1i71 PL2i1-PL2i73; infile in2 lrecl=1024 obs=1 missover dsd; *<---------------Read input file 2----------------; input _first14 $char14. recid2 7. +1 PL3i1-PL3i71 PL4i1-PL4i73; if recid ne recid2 or recid ne _n_ then do; *<---------------Verify file synchronization------; file log; put //'************Data Problem: The recid fields on the 2 input files do not match '/ 'each other or the SAS cycle counter (_n_): ' recid= recid2= _n_= ; list; abort 500; end; array pl1 (71) pl1i1-pl1i71; array pl2 (73) pl2i1-pl2i73; array pl3 (71) pl3i1-pl3i71; array pl4 (73) pl4i1-pl4i73; do index=1 to 73; if index le 71 then table1=pl1(index); table2= pl2(index); if index le 71 then table3=pl3(index); table4= pl4(index); output; end; keep index table1--table4; format index 3. table1-table4 comma7.; stop; run; proc print data=pl941obs; id index; title 'Cell Values for the Kansas State Summary Record'; run;