View previous topic :: View next topic
|
Author |
Message |
er.manishawasthii
New User
Joined: 24 Oct 2008 Posts: 6 Location: Pune
|
|
|
|
In this code i want to Place the column Postion in Proc Print .....
Means i need to fix the postion of column headings and its records to certain varibles ..... EMP no should start from 6 column , name should start from 15 and dept name should start from 32 postion how Could i do that........... |
|
Back to top |
|
|
er.manishawasthii
New User
Joined: 24 Oct 2008 Posts: 6 Location: Pune
|
|
|
|
here is the code
PROC SQL;
CREATE TABLE REPT AS
SELECT E.ENO,E.ENAME,D.DEPT_NAME
FROM EMPLOYEE E, DEPT D
WHERE E.EDEPT_CD = D.DEPT_CD
AND ESTATUS = 'A' ‘
AND ESAL BETWEEN 10000 AND 20000
ORDER BY DEPT_NAME ,ENO
%PUT &SYSDBRC;
RUN;
DATA _NULL_;
IF "&SYSDBRC" NOT IN ('0','100') THEN DO;
PUT 'READING SASCNT DB2 RETURN CODE : ' "&SYSDBRC";
ABORT ABEND;
END;
RUN;
PROC PRINT DATA = REPT LABEL NOOBS;
TITLE1 ' XYZ ORGANIZATION';
TITLE2 ' ACTIVE EMPLOYEES REPORT DT:' &SYSDATE;
LABEL EMPNO = 'EMPLOYEE_NO';
LABEL NAME = 'NAME ';
LABEL DEPT = 'DEPT_NAME';
RUN; |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
PROC PRINT does not allow you to set columns for its output. You can use PUT statements in a DATA step to control exact columns, but if you use PROC PRINT you have relatively little control over the format of the output report. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Why the "must do" for column positions ?
As Robert has correctly stated, this is not an option in PROC PRINT.
You could do it using filler fields, but that is oh sooooooooooooooo messy a way to do it. |
|
Back to top |
|
|
er.manishawasthii
New User
Joined: 24 Oct 2008 Posts: 6 Location: Pune
|
|
|
|
@ expat could u please explain it how could i do this using the filler filelds.......
Actually i don't want to use PUT statments and Data steps . I would like to learn about PROC PRINT . I have already made the previous code using the Put statments in Dta step . This time i thought of doing it in a diffrent way........using Proc Print |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Filler fields are blanks set to specific lengths to allow you to format the output from proc print, should you so wish to do.
Why the must for certain columns ? |
|
Back to top |
|
|
|