BookmarkSubscribeRSS Feed
rksenthil2003
Calcite | Level 5

Hi

I use SAS in mainframes, i use PROC PRINT to generate a report into a mainframe dataset. But SAS is splitting the records into multiple rows as the number of variables are more. I want all the variables of a record to be printed on a single row. I have no limitation on the LRECL of the dataset, i can extend it as much as to accommodate all variables in one row. I am not able to figure out any options to do this. Can any of you help me with this, please? I have been googling for the past 3 days with no luck. 😞

Thanks

Senthil

4 REPLIES 4
jakarman
Barite | Level 11

https://communities.sas.com/thread/48724

Is it the same?  errors notes?  Version?

---->-- ja karman --<-----
Tom
Super User Tom
Super User

Why are you using PROC PRINT instead of a DATA _NULL_ step to write to a file?

sandyming
Calcite | Level 5

I do not think that you can print all to one row if you have too many variables. You may try width=minimal, and ls ps options?

Astounding
PROC Star

Senthil,

If you follow the links that others have provided, the main idea is that SAS limits the width to 256 in the print file.  However, you might try to work around this by defining your own output file (either in a DD statement in the JCL or in a SAS FILENAME statement).  Assuming you had properly defined a file with a larger linesize:

//MYFILE DD ....

And assuming you had also tried OPTIONS LINESIZE=1000 (or whatever large value you would like), redirect the PROC PRINT output to this file using:

proc printto print=MYFILE;

Then see if your PROC PRINT behaves the way you would like.  If that doesn't do the trick, you would have to resort to Tom's suggestion.  Depending on the number of variables in your data set, that could be a burden.

Good luck.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1501 views
  • 0 likes
  • 5 in conversation