DATA Step, Macro, Functions and more

Browse a large format

Accepted Solution Solved
Reply
Super Contributor
Posts: 271
Accepted Solution

Browse a large format

[ Edited ]

 

https://communities.sas.com/t5/General-SAS-Programming/SAS-large-format/m-p/386954#M48990

 

 

Additional to the above question,May I ask how to browse a large SAS format?

 

Also, SAS format stored like a html file,I don't know how to split it as we split SAS dataset:jjj.png

 

Can we store SAS format to another type?

 

Thanks!


Accepted Solutions
Solution
‎08-28-2017 04:40 PM
SAS Super FREQ
Posts: 508

Re: Browse a large format

Posted in reply to GeorgeSAS

I am paraphrasing your questions hoping that I am correctly interpreting what you are saying.

 

Can you look at a large data set? Sure.  What do you want to see?  You certainly don't want to display the entire thing.

 

Use PROC PRINT with OBS= and FIRSTOBS= to see subsets.  Or use a WHERE clause to see other subsets.

 

proc print data=sashelp.iris(firstobs=10 obs=20); run;
proc print data=sashelp.iris(where=(species='Setosa')); run;

 

Use proc freq or proc summary.  There are lots of ways to look.

 

Why is html the default destination in some situations?  Well it seems like a reasonable choice.  Yes you can use ODS destination statements to change it to listing, pdf, rtf, or others.  I hope this helps and that I am understanding what you are asking.

View solution in original post


All Replies
Solution
‎08-28-2017 04:40 PM
SAS Super FREQ
Posts: 508

Re: Browse a large format

Posted in reply to GeorgeSAS

I am paraphrasing your questions hoping that I am correctly interpreting what you are saying.

 

Can you look at a large data set? Sure.  What do you want to see?  You certainly don't want to display the entire thing.

 

Use PROC PRINT with OBS= and FIRSTOBS= to see subsets.  Or use a WHERE clause to see other subsets.

 

proc print data=sashelp.iris(firstobs=10 obs=20); run;
proc print data=sashelp.iris(where=(species='Setosa')); run;

 

Use proc freq or proc summary.  There are lots of ways to look.

 

Why is html the default destination in some situations?  Well it seems like a reasonable choice.  Yes you can use ODS destination statements to change it to listing, pdf, rtf, or others.  I hope this helps and that I am understanding what you are asking.

Super Contributor
Posts: 271

Re: Browse a large format

Posted in reply to WarrenKuhfeld

Thank you,

 

Browse a SAS data set is no problem but how about SAS format?

 

Thanks

Super User
Posts: 13,920

Re: Browse a large format

Posted in reply to GeorgeSAS

GeorgeSAS wrote:

Thank you,

 

Browse a SAS data set is no problem but how about SAS format?

 

Thanks


You mentioned:

Also, why SAS format are stored as html type file?

SAS does not store formats in html. SAS stores formats in catalogs.

Run this code:

Proc format library=work;

value junk

1 = 'value'

;

run;

 

Look in the WORK library. You will see a catalog named Formats.If you open that catalog, or run the proc catalog code in another part of this thread, you will see the format Junk in that catalog.

If you have something in HTML it was exported or created by someone and is no longer a "format" but an html file.

Reading from html is possible to create a data set but will depend on the actual content of the html.

 

 

Super User
Posts: 13,920

Re: Browse a large format

Posted in reply to GeorgeSAS

This time will you show some of the actual code youi are running and any of the results?

 

It is very frustrating to see the same question especially when you do not include the information from questions asked in earlier basically identical questions such as 1) this is an OLD format (supposedly) that you do not have the code or data set that generated the format; is running on a mainframe; that you get error messages related to memory limits; that you either have not/will not or cannot get more memory allocated to the procedure.

 

Have you run the previously suggested code:

 

proc catalog catalog=lib.formats;

contents;

run;

on the catalog containing the format?

Can you share the result?

 

SAS Formats are NOT stored in HTML files, they are stored in catalogs which is a SAS specific file format. If you have an html file then it is not a catalog but may have been exported in which case you really have to show the entire code of what you may have attempted.

Super Contributor
Posts: 271

Re: Browse a large format

[ Edited ]
filename ffout .;
proc catalog catalog=lib.formats;
contents FILE=ffout;
run;
quit;

 

This is result you want to see:

 

 

Name Type Description Create Date Modify Date

LARGEJK                       FORMATC                                               21Aug17:17:27:43    21Aug17:17:27:43

Total number of entries: 1

 

I would like to combine this topic with the old one, the reason I open this new one is I don't want the question jump to much that confuse you.

 

I can browse SAS format only within a html style output. is there any other way to browse a format? I can't browse the format(LARGEJK) ,it is too large.

 

There is no firstobs=  obs= option for a format.

jjj.png

 

Thanks!

Community Manager
Posts: 3,456

Re: Browse a large format

[ Edited ]
Posted in reply to GeorgeSAS

If I can rephrase the question... Let me know if I've got it wrong.

 

Suppose you have a user-defined SAS format with lots of rules (thousands or millions).  How can you see a listing of all of those rules?  If you use the CATALOG window in Base SAS and double-click on a SAS format entry, SAS issues something like:

 

proc format fmtlib lib=dbmlnx.formats; 
 select bigfmt; 
run; 

This produces ODS output -- HTML by default -- that can be impossible to load/view due to its size.

 

You could workaround by defining your own ODS destination and writing your own code.

 

ods _all_ close;
options ps=max;
ods listing file="c:\temp\bigformat.lst"; 
proc format fmtlib lib=dbmlnx.formats; 
 select bigfmt; 
run; 
ods listing close; 

This creates a text file that you can open in your favorite text editor that handles large files.

 

Or you can use PROC FORMAT CTLOUT= to create a SAS data set version of the format, and then view that in VIEWTABLE or the EG table viewer or SAS Studio -- all of which can handle data sets with millions of rows.

Super Contributor
Posts: 271

Re: Browse a large format

[ Edited ]
Posted in reply to ChrisHemedinger

Thank you!

%macro makefmt;
Proc format library=work;
value j3unk
%do i=1 %to 100;
&i. = "value&i."
%end;
;
run;
%mend makefmt;
%makefmt;
ods _all_ close;
options ps=max;
ods listing file="c:\temp\bigformat" ; 
proc format fmtlib lib=work.formats; 
select j3unk; /*obs=10 only works for sas dataset;SAS format can't be splitted as sas dataset*/
run; 
ods listing;

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 216 views
  • 4 likes
  • 4 in conversation