08-19-2015 01:03 PM
I am reading few values from a input dataset, using SAS in mainframes.
And while writing to the output dataset, I need to add titles/header/labels(not sure what we is the exact syntax in sas) for those fields.
Input file layout:
output file should be as follows: File should have first record as description/title/label for the upcoming records: Kinda of title for all those fields
AREA, LOC , CC ,DEPT
I cant try proc print, because I am writing all records to a output dataset and not in sas log.
Also if i use
proc print data=infile1 label;
I am getting spaces between all those Fields.
09-16-2015 03:40 PM
Hi, this only works if all the variables are defined as character.
length AREA LOC CC DEPT $20;
input area loc cc dept;
LA 80002 1942 1040
LA 80002 1842 1940
LA 80004 1713 1510
proc contents data = test1 out = cont (keep = name) ; run;
proc transpose data = cont out = vars (drop = _name_ _label_);
set vars test1;
09-16-2015 04:00 PM
Looks like you are just writng a CSV file. You can try using PROC EXPORT. Or you can just do it with a data step.