BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
GeorgeSAS
Lapis Lazuli | Level 10

 

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!

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenKuhfeld
Rhodochrosite | Level 12

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

7 REPLIES 7
WarrenKuhfeld
Rhodochrosite | Level 12

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.

GeorgeSAS
Lapis Lazuli | Level 10

Thank you,

 

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

 

Thanks

ballardw
Super User

@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.

 

 

ballardw
Super User

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.

GeorgeSAS
Lapis Lazuli | Level 10
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!

ChrisHemedinger
Community Manager

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.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
GeorgeSAS
Lapis Lazuli | Level 10

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;

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 7 replies
  • 966 views
  • 4 likes
  • 4 in conversation