IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SAS Question- How to Place the Column Postion in Proc Print


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
er.manishawasthii

New User


Joined: 24 Oct 2008
Posts: 6
Location: Pune

PostPosted: Tue Dec 09, 2008 7:02 pm
Reply with quote

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
View user's profile Send private message
er.manishawasthii

New User


Joined: 24 Oct 2008
Posts: 6
Location: Pune

PostPosted: Tue Dec 09, 2008 7:07 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Dec 09, 2008 7:19 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Dec 09, 2008 9:07 pm
Reply with quote

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
View user's profile Send private message
er.manishawasthii

New User


Joined: 24 Oct 2008
Posts: 6
Location: Pune

PostPosted: Wed Dec 10, 2008 12:33 pm
Reply with quote

@ 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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Dec 10, 2008 2:29 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
No new posts Question for file manager IBM Tools 7
Search our Forums:

Back to Top