Okay, as I said, the code works. But I have to do some post transpose formatting to get the date variable to act like a date. Trying to modify code so it will do this in one step, but I have to revert to importing date as character value. Here is modified code. Also for some reason, this code does not like using a CSV file created within Excel. This is reason for first two blocks of code. PROC IMPORT OUT= WORK.TEMP DATAFILE= "C:\Users\Matt\Desktop\Research Projects\Bond Yiel ds, Governance, Default Risk\Excel Data\CVX_1.csv" DBMS=CSV REPLACE; GETNAMES=NO; DATAROW=1; RUN; PROC EXPORT DATA= WORK.TEMP OUTFILE= "C:\Users\Matt\Desktop\Research Projects\Bond Yield s, Governance, Default Risk\Excel Data\CVX_1a.csv" DBMS=CSV LABEL REPLACE; PUTNAMES=YES; RUN; filename in 'C:\Users\Matt\Desktop\Research Projects\Bond Yields, Governance, Default Risk\excel data\cvx_1a.csv'; data out ; array names (5000) $20 _temporary_ ; length name $20 Date $20 Cvx 3.2; infile in dsd lrecl=300000 truncover ; if _n_=1 then do ; do ncols=1 by 1 until(name=' '); input name @ ; end; input ; do i=1 to ncols/2 ; input name name @ ; names(i)=name; end; input ; end; do i=1 to ncols/2 ; input Date Cvx @ ; if not ( missing(Date) and missing(Cvx) ) then do ; name = names(i); output ; end; end; keep name Date cvx ; retain ncols; run; proc sort data=out out=Import; by name date; run;
... View more