Here is another way that might be simpler depending on what you have.......with a PROC SQL. The IN dataset is what has the headers. The "test" dataset does not have proper headers but has names like v1, v2, v3, v4, v5. This data is inserted into IN as shown below.... DATA IN;
SET SASHELP.CLASS(OBS=1);
RUN;
data test;
infile datalines dlm='|';
input V1:$8. V2:$1. V3:4. V4:4. V5:4.;
datalines;
Alice|F|13|56.5|84.0
Barbara|F|13|65.3|98.0
;
RUN;
PROC SQL;
INSERT INTO IN SELECT * FROM TEST;
QUIT;
PROC PRINT DATA=IN;TITLE '==IN';
PROC PRINT DATA=TEST;TITLE '==TEST'; Please note that this involves I/O read/writes but is a simple INSERT statement interms of coding. The output results shows this below: ==IN
Obs Name Sex Age Height Weight
1 Alfred M 14 69.0 112.5
2 Alice F 13 56.5 84.0
3 Barbara F 13 65.3 98.0
==TEST
Obs V1 V2 V3 V4 V5
1 Alice F 13 56.5 84
2 Barbara F 13 65.3 98 Hope this helps...!!!
... View more