Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

PROC PRINT in SAS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
mambopras

New User


Joined: 11 Nov 2008
Posts: 52
Location: Hyderabad

PostPosted: Fri May 27, 2011 1:04 am    Post subject: PROC PRINT in SAS
Reply with quote

i want to use a PROC PRINT in SAS but not center the TITLES, I want to just center the data. Is this possible ? If so, can you please let me know how ???
Back to top
View user's profile Send private message

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Fri May 27, 2011 12:21 pm    Post subject:
Reply with quote

Hello,

You could try the below code for your requirement,
Code:
option nodate nonumber;                                               
title 'Superstar Rajni Vaalga';            *<--- Your title statement;
                                                                       
proc sql noprint;                                                     
  select setting length=3 into :ls_len                                 
    from dictionary.options                                           
    where optname='LINESIZE';                                         
  select count(*), text length=&ls_len into :count,                   
                 :ttl_1-:ttl_10 notrim                                 
    from dictionary.titles                                             
    where type='T'                                                     
    order by number;                                                   
quit;                                                                 
                                                                       
%macro tls_;                                                           
  %do i = 1 %to &count;                                               
    title&i. "&&ttl_&i";                                               
  %end;                                                               
%mend;                                                                 
                                                                       
%tls_;                                                                 
                                                                       
proc print data=sashelp.class;                  *Your proc print step;
run;                                                                       


Output:
Code:
Superstar Rajni Vaalga                                       
                                                             
              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
                4    Carol       F      14     62.8      102.5
                5    Henry       M      14     63.5      102.5
                6    James       M      12     57.3       83.0


Hope it helps.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Fri May 27, 2011 12:25 pm    Post subject:
Reply with quote

I dont know why the below code does not work for me, you could try this on your SAS installation.

Code:
title1 'some title' justify=left;   
proc print data =sashelp.class;
run;     
Back to top
View user's profile Send private message
mambopras

New User


Joined: 11 Nov 2008
Posts: 52
Location: Hyderabad

PostPosted: Sat May 28, 2011 12:16 am    Post subject:
Reply with quote

I will have to try the code, thanks for the help
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7908
Location: Bellevue, IA

PostPosted: Sat May 28, 2011 1:13 am    Post subject:
Reply with quote

Although I haven't had a chance to try this yet, the manual at SAS Support says it works:
Code:
TITLE1 JUSTIFY=LEFT 'TITLE TEXT';
and the JUSTIFY must precede the text.
Back to top
View user's profile Send private message
mambopras

New User


Joined: 11 Nov 2008
Posts: 52
Location: Hyderabad

PostPosted: Sat May 28, 2011 3:57 pm    Post subject: Re:
Reply with quote

I tried that and I couldn't succeed, but it is my mistake that I haven't explained the intricacy in the requirement and was expecting an answer. I want a part of my title to be centered and a part left justified (both of them should be on the same line).... I am trying with JUSTIFY statements..but no luck yet.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Sat May 28, 2011 4:17 pm    Post subject:
Reply with quote

So, you have a user who wants exactly the output he wants from a product whose standard output probably satisfies most users.

You end up spending 50% of the effort in getting the report looking how he/she wants.

Can you make your title into one long literal of 132 characters and just exactly spaced how he/she wants it? It will "look" like part of it is left-justified and part centred.

I used a different product where we had the same problem. An un-moving user who wanted the report to look like all the other reports he'd ever seen, but which would have almost meant no point in using the reporting product purchased to give him the new reports he wanted quickly.

However, the product allowed us to write an "exit" program for the report output, so in the "exit" (a Cobol program) we could do his exact heading/footer style and from the reporting tool use all the quick-and-easy features of the report. I have no idea if this is an option for SAS.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Sat May 28, 2011 4:27 pm    Post subject:
Reply with quote

Try PROC REPORT.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Sat May 28, 2011 4:48 pm    Post subject:
Reply with quote

Quote:
I tried that and I couldn't succeed, but it is my mistake that I haven't explained the intricacy in the requirement and was expecting an answer. I want a part of my title to be centered and a part left justified (both of them should be on the same line).... I am trying with JUSTIFY statements..but no luck yet.


You could have shown us a sample of the output required in the first place..

Quote:
try proc report

I guess proc report allows customizations of individual columns and formatting flexibility, as far as customizing title statements, proc report and proc print have no difference.(im willling to be corrected here)
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7908
Location: Bellevue, IA

PostPosted: Sat May 28, 2011 5:31 pm    Post subject:
Reply with quote

What you want to do can be done by using NOTITLES on the FILE statement and then put data in the exact columns you want on each line. Of course, this means you are NOT using a PROC to print, but writing your own code to output every byte on every line of the page. The effort is much, much higher than using PROC PRINT or PROC REPORT, but on the other hand it allows you to achieve results that those procedures won't support.
Back to top
View user's profile Send private message
mambopras

New User


Joined: 11 Nov 2008
Posts: 52
Location: Hyderabad

PostPosted: Sun May 29, 2011 1:07 pm    Post subject:
Reply with quote

Robert,
we ended up doing the same, it increased the coding effort a lot as you said - But that had its own problems too as we had to handle each column separately. I was just not comfortable with the effort we were putting in, so tried reading manuals and searching over the net if we have any option in PRO PRINT itself. However we have taken the long route!!!

Peter, I have to read about PROC REPORT, may be I will try it.

Thanks to all of you for your suggestions and ideas..
Back to top
View user's profile Send private message
mambopras

New User


Joined: 11 Nov 2008
Posts: 52
Location: Hyderabad

PostPosted: Sun May 29, 2011 1:12 pm    Post subject:
Reply with quote

But just as an after thought, I still dont believe that we do not have a better or efficient way of handling the title stuff as we want - SAS being such a powerful tool . . .It would be nice if any discoveries in the future about this be shared. ( I would share mine too if I come across any ).
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sun May 29, 2011 1:39 pm    Post subject: Reply to: SAS question
Reply with quote

why not check also
http://support.sas.com/forums/index.jspa?categoryID=1
where You might get answers also from the SAS people themselves ?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Sun May 29, 2011 1:39 pm    Post subject:
Reply with quote

I have done such a thing once, that's the reason I asked for a sample output of what is required.
Back to top
View user's profile Send private message
mambopras

New User


Joined: 11 Nov 2008
Posts: 52
Location: Hyderabad

PostPosted: Sun May 29, 2011 2:21 pm    Post subject:
Reply with quote

Vasanth,
I got your point - But there are copy - paste issues on my work pc - basically clipboard problems. Will try FTPing it.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sun May 29, 2011 2:26 pm    Post subject: Reply to: SAS question
Reply with quote

the best way ( in my experience at least ) to copy and past from the 3270 emulator

is to use a PC editor with a fixed font, copy and paste, fix the small details
and cut and paste from there to the forum post

easier also to check for tupogryplical errors
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon May 30, 2011 1:23 am    Post subject:
Reply with quote

Or simply copy from the 3270 emulator screen and paste into the Reply Editor here. Then highlight and click the "Code" tag.

We have a Preview function so you can see your post as it will appear to the forum (rather than how it appears in this editor). Once the post appears as you want, click Submit.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts New PROC not reflecting in prod even ... Musab Ahmed CA Products 9 Tue Mar 15, 2016 12:45 pm
No new posts print out the correct info in LOOP? jackzhang75 CLIST & REXX 7 Wed Dec 23, 2015 10:39 pm
No new posts PROC to JCL mapping jena_samirkumar JCL & VSAM 13 Tue Dec 08, 2015 12:37 pm
No new posts JCL/job to PROC -- Symbolic to be use... Elixir JCL & VSAM 2 Thu Aug 20, 2015 2:56 am
No new posts How to print a variable in SAS progra... LOKESH DAIVAM All Other Mainframe Topics 6 Thu Aug 13, 2015 12:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us