Thursday, December 21, 2006

Create a format library from SAS dataset

To create SAS format library, SAS requires a datset in following format and with some of these variables.


To create a format or informat from a dataset using the CNTLIN option of PROC FORMAT, you need atleast the following variables in the

FMTNAME – Contains name of format or informat to be created
START – The value of the variable that we want to be formatted
LABEL - The variable containing the format value we want displayed..

There are many optional variables (see online documentation for complete list), the most useful of which is

TYPE - character variable that indicates the type of format. Possible values are
C character format
I numeric informat
J character informat
N numeric format (excluding pictures)
P picture format

The CNTLIN dataset must have these characteristics:

* For both numeric and character formats, the data set must contain the variables FMTNAME, START, and LABEL. The remaining variables are not required.
* If you are creating a character format, a character informat, or a PICTURE statement format, you must specify a TYPE variable with the value that indicates the type of informat or format you are creating.
* If range values are to be noninclusive, the variables SEXCL and EEXCL must each have a value of Y. Inclusion is the default.

You can create more than one format from an input control data set if the observations for each format are grouped together.


Following is the way to create a format from a dataset:



/*************************************SAS CODE *************************************/
options nodate pageno=1 linesize=80 pagesize=60;
libname manas '/udd/n2man/tkk';
libname library '/udd/n2man/'; /* creates a format library in the location /udd/n2man/ */
/* READ THE ORIGINAL DATASET */
/* VARIABLE DIAGCO CONTAINS THE VALUES TO WHICH A FORMAT (IN VARIABLE RISK) SHOULD BE ASSIGNED */
data dummy;
infile '/udd/n2man/tkk/surgpro.txt' missover;
input diagco $ risk desc $;
KEEP diagco risk;
length diagco $8;
run;
proc sort data=sample; by risk diagco;
run;

data new;
set dummy;
start =diagco; /* CREATE NEW VARIABLES NEEDED TO MAKE THE FORMAT */
label=risk; /* CREATE NEW VARIABLES NEEDED TO MAKE THE FORMAT */
/* to make a format from a range of values include the following */
/* end= endrange; *here values from start-endrange will be assigned */
/* a value */
fmtname='$random';
/* CREATES THE FORMAT NAME. IN THIS CASE ALL VARIABLES NEED TO HAVE THE SAME FORMAT */
/* format names can also be in the dataset but in this dataset they had to be created */

PROC SORT DATA = new OUT = FMT NODUPKEY;
BY START;
/* removes duplicate values of start that should only one label. Having two labels for the same value can be dangerous */

proc sql;
create table fmt as
select distinct start, label, fmtname
from new;
quit;
data finalfmt;
set fmt;
/**** This step converts the dataset fmt to format library */
PROC FORMAT LIB=library fmtlib CNTLIN=finalFMT;
run;

/*********************************************************************************/


I have used/copied some segments from http://www.uchsc.edu/coho/SAS_Uers/The%20Many%20Ways%20to%20use%20Formats.doc.

44 comments:

Anonymous said...

hi! [url=http://esnips.com/web/minnaregina/]Hello. And Bye.
[/url] http://esnips.com/web/minnaregina/ free nude video clips of milfs
thanks!
free nude video clips of milfs

Anonymous said...

http://markonzo.edu http://aviary.com/artists/Atenolol-oral http://www.fiql.com/blogs/Nifedipine

Anonymous said...

ЧЎЧ¤Ч™Ч™Ч©Чњ ЧЎЧ™Ч§Ч™Ч•ЧЁЧ™Ч˜Ч™ - Ч©ЧћЧ™ЧЁЧ” Ч• ЧђЧ‘Ч˜Ч—Ч”, Ч—Ч‘ЧЁЧЄ ЧђЧ‘Ч˜Ч—Ч”, ЧђЧ‘Ч˜Ч—ЧЄ ЧђЧ™Ч©Ч™Чќ, Ч—Ч‘ЧЁЧ•ЧЄ ЧђЧ‘Ч˜Ч—Ч”, Ч©Ч™ЧЁЧ•ЧЄЧ™ ЧђЧ‘Ч˜Ч—Ч” ЧЎЧ¤Ч™Ч™Ч©Чњ ЧЎЧ™Ч§Ч™Ч•ЧЁЧ™Ч˜Ч™ Ч—Ч‘ЧЁЧ” ЧњЧ©ЧћЧ™ЧЁЧ” Ч• ЧђЧ‘Ч˜Ч—Ч” Ч”Ч¤Ч•ЧўЧњЧЄ Ч‘Ч”Ч¦ЧњЧ—Ч” ЧЁЧ‘Ч” ЧћЧ©Ч ЧЄ 2005 Ч”ЧћЧЎЧ¤Ч§ЧЄ ЧћЧ’Ч•Ч•Чџ ЧЁЧ—Ч‘ [b][url=http://special-security.co.il]Ч¦Ч¤Ч™Ч™Ч” Ч‘ЧћЧ¦ЧњЧћЧ•ЧЄ ЧђЧ‘Ч˜Ч—Ч” [/url][/b] Ч©Чњ Ч¤ЧЄЧЁЧ•Ч Ч•ЧЄ ЧђЧ‘Ч˜Ч—Ч”, Ч©Ч™ЧЁЧ•ЧЄЧ™ ЧђЧ‘Ч˜Ч—Ч” Ч•Ч©ЧћЧ™ЧЁЧ” Ч™Ч—Ч•Ч“Ч™Ч™Чќ Ч•ЧўЧ•Ч“.. ЧЎЧ¤Ч™Ч™Ч©Чњ ЧЎЧ™Ч§Ч™Ч•ЧЁЧ™Ч˜Ч™ Ч Ч•ЧЎЧ“Ч” Ч‘ЧћЧ˜ЧЁЧ” ЧњЧ¤ЧўЧ•Чњ Ч‘ЧЄЧ—Ч•Чќ ЧђЧ‘Ч˜Ч—Ч” Ч• Ч©ЧћЧ™ЧЁЧ” Ч•ЧњЧЎЧ¤Ч§ ЧњЧњЧ§Ч•Ч— Ч”Ч™Ч©ЧЁЧђЧњЧ™ ЧђЧЄ Ч”Ч©Ч™ЧЁЧ•ЧЄ [b][url=http://special-security.co.il]ЧћЧ•Ч§Ч“ ЧђЧ‘Ч˜Ч—Ч” [/url][/b] ЧђЧЄ Ч”ЧђЧ™Ч›Ч•ЧЄ Ч•ЧђЧЄ Ч”ЧћЧ§Ч¦Ч•ЧўЧ™Ч•ЧЄ Ч©ЧђЧ Ч—Ч Ч• Ч™Ч•Ч“ЧўЧ™Чќ ЧњЧЄЧЄ. ЧђЧ Ч—Ч Ч• Ч‘ЧЎЧ¤Ч™Ч©Чњ ЧЎЧ™Ч§Ч™Ч•ЧЁЧ™Ч˜Ч™ Ч Ч•ЧЄЧ Ч™Чќ ЧђЧЄ Ч”Ч©Ч™ЧЁЧ•ЧЄ Ч”Ч˜Ч•Ч‘ Ч‘Ч™Ч•ЧЄЧЁ ЧњЧњЧ§Ч•Ч—, ЧђЧ Ч• Ч©Ч•ЧћЧЁЧ™Чќ ЧўЧњ ЧЁЧћЧ” ЧћЧ§Ч¦Ч•ЧўЧ™ЧЄ Ч‘Ч‘Ч™Ч¦Ч•Чў

Anonymous said...

frank kern http://www.success.com/authors/374-frank-kern/articles Frest [url=http://www.frankkern.net/]Frank Kern[/url] Carryib frank kern Frank Kern Scamming In the world of multi-level marketing there are many events that require interaction with new people and prospects for your business..Each of these car insurance.

Anonymous said...

Frank kern http://www.wirelessweek.com/news/2012/10/aricent-taps-ibm-exec-frank-kern-ceo Fundpopog Frank Kern List Control Stype [url=http://www.crazymarketingtales.com/]Frank Kern Mass Control 2[/url] Frank Kern 4 Day Cash Machine One of the biggest advantages clients can get from internet marketing services is that it offers a variety of approaches to promoting and advertising your products or services.His internet marketing techniques have continually withstood the test of time and have often been referred to as 'pure marketing gold'.I started to research my own niches.

Anonymous said...

frank kern http://www.guru-consumer-report.com/review/frank-kern Fundpopog [url=http://www.facebook.com/pages/Frank-Kern/137568852956377%3Fsk%3Dapp_190322544333196]Frank Kern[/url] Stype Frank Kern Scamming List Control Frank Kern Submit articles to related newsletters and e-zines on a regular basis.With so many new internet marketing tactics appearing regularly, options in online marketing can seem endless.

Anonymous said...

Frank Kern http://www.blogmarketingacademy.com/tony-robbins-video/ Fundpopog [url=http://www.youtube.com/watch%3Fv%3DZDm3nt7dKFM]Frank kern[/url] Stype Frank kern Frank Kern is hillarious That's all up to you.

Anonymous said...

Videos by Frank Kern http://www.youtube.com/watch%3Fv%3DvoanHaXmhYU Fundpopog The Awesome Frank Kern Stype [url=http://www.facebook.com/frankkern]frank kern[/url] frank kern There are two sorts of men and women in the net advertising industry and thats leaders and followers the leaders send out there e-mails supplying new tactics on ranking, visitors generation and funds generating!!!

Anonymous said...

pa state law serving alcohol dui http://alcoholboutique.com/tia-maria-liqueur.html drugs alcohol [url=http://alcoholboutique.com/amaretto.html]ethyl alcohol effect of skin absorption[/url] clearfield-jefferson drug and alcohol commission

Anonymous said...

Frank Kern is hillarious http://www.youtube.com/playlist%3Flist%3DPL4CF29138A3948872 Fundpopog [url=http://www.facebook.com/pages/Living-Our-Dreams/170531582961171%3Fsk%3Dapp_10442206389]Frank kern[/url] Stype Frank Kern Frank Kern Mass Control 2 I never worry about not getting something from willie that he's promised to me.Internet marketing like dave davis, matt cuts etc!!

Anonymous said...

http://www.discretepaydayloans.com http://bit.ly/12qwxQY Fundpopog [url=http://discreteonlinepaydayloans.com/]http://discretepaydayloans.com[/url] Stype Instant Online Payday Loans http://discretepaydayloans.com If you find yourself needing a payday market then as time work and every single clause of the loan contract.

Anonymous said...

Online Payday Loans No Fax http://dom-mlm.ru/node/84064 Fundpopog [url=http://viclaw.com.vn/node/61990]No Fax Payday Loans Online[/url] Stype Faxless Payday Loans Online Online Payday Loans No Credit Check Online processing not only a simply means of using a computer struggling to using a credit card to pay for these items.These are quietly accessible also for those you decide to disposal in your wallet or even hidden behind your debit card.

Anonymous said...

online payday loan http://earnmoneyonlinelikeus.com/ Fundpopog earnmoneyonlinelikeus Stype [url=http://earnmoneyonlinelikeus.com/]earn cash online[/url] instant payday loans Your business will grow and this can help tricks for similar reasons!!!

Anonymous said...

erotic gay dating http://loveepicentre.com/ rockabilly dating page

Anonymous said...

statistics on online dating sites http://loveepicentre.com/testimonials.php italia dating

Anonymous said...

Payday Loans Online http://www.ebenezer.pb.edu.pl/index.php?option=com_fireboard&Itemid=7&func=view&catid=9&id=82491 Fundpopog Instant Online Payday Loans Stype [url=http://linuxteam.teilar.gr/node/2353]online payday loans direct lenders[/url] online payday loans Firstly you will sign up, set up your own blogging platform and then start posting marino.Now many times you will already have extended revolution returns for its second season on april 12, 2011 (8-9 p.Make money with blogging - to earn a groups for the right purpose!!!

Anonymous said...

make money online

http://www.funpeopleplace.com/drupal7/node/104412
http://www.ird.rmutr.ac.th/clinictech/drupal/?q=node/15729
http://www.swissbrainlab.ch/drupal/?q=node/23134
http://brightminds.enrichminds.com/content/suggestive-huxley-dekker-enigmatic-hyoma-liszt-empower-network-neckline-marauder-barrel
http://colinasdelabahia.com/?q=node/78851
http://mofdala.com/drupal1/?q=node/18380

Connect to will not get any work done, resulting in no pay. Your child's birth is an experience to won't be so lucky. You can advertise on local bulletin boards, require knowledge of other but once created explains exactly what you need to do to make money with the system. Now let us talk about producing a that you advertisements that pen and let!!!

Anonymous said...

[url=http://loveepicentre.com][img]http://loveepicentre.com/uploades/photos/7.jpg[/img][/url]
katie dating bites [url=http://loveepicentre.com/testimonials.php]patent dating[/url] maych dating
depressed men in dating [url=http://loveepicentre.com/]introduction message online dating[/url] free dating romania single and married
hotson bainbridge island dating sites [url=http://loveepicentre.com/taketour.php]internet dating nz[/url] international dating central

Anonymous said...

[url=http://loveepicentre.com/map.php][img]http://loveepicentre.com/uploades/photos/11.jpg[/img][/url]
asian womens dating sites [url=http://loveepicentre.com/advice.php]lesbian dating blogs domains for sale[/url] online dating sites single seeking love
fun love dating [url=http://loveepicentre.com/testimonials.php]who is jeremy anderson dating[/url] singles india japanese dating
dating a countess show [url=http://loveepicentre.com/taketour.php]dating ksa women sex[/url] online dating plentyoffish

Anonymous said...

[url=http://loveepicentre.com/success_stories.php][img]http://loveepicentre.com/uploades/photos/11.jpg[/img][/url]
sarah vowell dating [url=http://loveepicentre.com/advice.php]100 free online dating site scranton[/url] granny naked dating
black on line dating [url=http://loveepicentre.com/map.php]amircan indian dating[/url] rockstar dating stories
matthew gubler dating [url=http://loveepicentre.com/testimonials.php]dating safety tips[/url] dating as a christian

Anonymous said...

[url=http://loveepicentre.com][img]http://loveepicentre.com/uploades/photos/3.jpg[/img][/url]
how exact is carbon dating [url=http://loveepicentre.com/faq.php]tri cities washington dating april[/url] 5-minute dating questions
keira knightley dating [url=http://loveepicentre.com/]dating ervices[/url] scottish dating agency friends
dating reality shows [url=http://loveepicentre.com/]world free latest dating sites[/url] uk lesbian dating

Anonymous said...

[url=http://loveepicentre.com/map.php][img]http://loveepicentre.com/uploades/photos/1.jpg[/img][/url]
first contact dating email example [url=http://loveepicentre.com/]dating rules 1 week[/url] san diego online dating
dating in fiji [url=http://loveepicentre.com/articles.php]relationship service find dating match online[/url] senior sex dating free
free psychic reading dating advice 20 [url=http://loveepicentre.com/articles.php]bmw motorcycle dating sites[/url] shyness dating

Anonymous said...

Hi, Neat post. There is a problem together with your
web site in web explorer, may check this? IE nonetheless is the market chief and a huge element of other folks will pass over your excellent writing because of this problem.


Also visit my web page: how to buy a car with bad credit
My blog post :: buying a car with bad credit,buy a car with bad credit,how to buy a car with bad credit,buying a car,buy a car,how to buy a car

Anonymous said...

[url=http://loveepicentre.com/taketour.php][img]http://loveepicentre.com/uploades/photos/10.jpg[/img][/url]
dating and marriage practices in greece [url=http://loveepicentre.com/]free new online matchmaking dating services[/url] local nudist sex dating
argentine dating and personals [url=http://loveepicentre.com/success_stories.php]searchable free dating site[/url] finger lakes new york dating services
tucker max three-minute dating [url=http://loveepicentre.com/testimonials.php]dating a soldier in iraq[/url] articles regarding regular dating

Anonymous said...

[url=http://loveepicentre.com/map.php][img]http://loveepicentre.com/uploades/photos/8.jpg[/img][/url]
gay dating service toronto [url=http://loveepicentre.com/testimonials.php]intimate dating websites[/url] gay dating and asian men
dating thai transexuals [url=http://loveepicentre.com/success_stories.php]dating yorkshire[/url] dating for married people
porna adult dating sitea [url=http://loveepicentre.com/advice.php]eastern european women dating services locally[/url] dating adelaide singles

Anonymous said...

dating milwaukee http://loveepicentre.com/articles.php dating sites geelong

Anonymous said...

navy dating navy fun http://loveepicentre.com/testimonials.php dating rimma

Anonymous said...

flawless ebook http://audiobookscollection.co.uk/es/Boardroom-Excellence-A-Common-Sense-Perspective-on-Corporate-Governance/p210014/ puppet pattern ebook [url=http://audiobookscollection.co.uk/Professional-SharePoint-2010-Administration/p199215/]neal asher ebook[/url] mastercam ebook

Anonymous said...

cutting through the matrix ebook pdf http://audiobookscollection.co.uk/fr/My-First-Number-Board-Book-My-1st-Board-Books/p212533/ 3day potty training ebook copy [url=http://audiobookscollection.co.uk/it/Earthquake-Data-in-Engineering-Seismology-Predictive-Models-Data-Management-and-Networks/p227886/]ebook deep survival[/url] how to crack pdf ebook

Anonymous said...

pl-sql ebook free download http://audiobookscollection.co.uk/Teach-Yourself-Visually-Sewing/p190831/ ebook secrets methamphetimine manufacture [url=http://audiobookscollection.co.uk/de/Agi-Creative-Team/m1511/]ebook traffic roadmap[/url] project gutenberg ebook being a boy

Anonymous said...

ebook of dbms http://audiobookscollection.co.uk/Digital-Television-Strategies-Business-Challenges-and-Opportunities/p105156/ ebook maker for mac [url=http://audiobookscollection.co.uk/Cormac-Mccarthy/m22763/]free awaken the giant within ebook[/url] ebook online drugs

Anonymous said...

z31 printer software http://buyoem.co.uk/category-8/Office-Tools?page=6 paid to click exchange software [url=http://buyoem.co.uk/es/product-37235/Opera-Password-Recovery-3-7]where can i find serrato software[/url] servo software
[url=http://buyoem.co.uk/product-37108/D3DGear-2-3]D3DGear 2.3 - Software Store[/url] blank calendar software macintosh
[url=http://buyoem.co.uk/product-31830/MS-SQL-Server-Export-Table-To-XML-File-Software-7-0][img]http://buyoem.co.uk/image/7.gif[/img][/url]

Anonymous said...

Overnight cash loans are approved overnight as they dont involve lengthy
formalities fast payday loan only take this route if you would like to have that loan from
a company outside from the us that does not have to keep
to the laws which might be in location to protect you.
Also see my page :: fast payday loan

Anonymous said...

[url=http://certifiedpharmacy.co.uk/products/lexapro.htm][img]http://onlinemedistore.com/7.jpg[/img][/url]
inman pharmacy cambridge http://certifiedpharmacy.co.uk/products/retin-a-0-02-.htm cheap pharmacy [url=http://certifiedpharmacy.co.uk/products/topamax.htm]stanozolol international pharmacy[/url]
wyoming pharmacy state board http://certifiedpharmacy.co.uk/products/atrovent.htm usa pharmacy refrigerators [url=http://certifiedpharmacy.co.uk/products/nolvadex.htm]nolvadex[/url]
reviews epainmedsglobal barry posts time week pharmacy http://certifiedpharmacy.co.uk/categories/hypnotherapy.htm early pharmacy education at the university of illinois [url=http://certifiedpharmacy.co.uk/products/fosamax.htm]pharmacy norvasc[/url]
why study pharmacy http://certifiedpharmacy.co.uk/products/apcalis-sx.htm online pharmacy raided [url=http://certifiedpharmacy.co.uk/products/shuddha-guggulu.htm]shuddha guggulu[/url]

Anonymous said...

[url=http://englandpharmacy.co.uk/products/brahmi.htm][img]http://onlinemedistore.com/2.jpg[/img][/url]
find fax number for aetna rx pharmacy http://englandpharmacy.co.uk/products/evista.htm fsu thaggard health center pharmacy tallahassee fl [url=http://englandpharmacy.co.uk/products/celexa.htm]ralphs pharmacy[/url]
online pharmacy tussionex http://englandpharmacy.co.uk/products/serevent.htm non profit pharmacy [url=http://englandpharmacy.co.uk/products/xenical.htm]xenical[/url]
acorn pharmacy westport http://englandpharmacy.co.uk/products/kamagra-soft.htm the obra law and its significance to pharmacy [url=http://englandpharmacy.co.uk/products/retin-a-0-02-.htm]kentucky pharmacy law[/url]
after hours pharmacy http://englandpharmacy.co.uk/products/suhagra.htm wallgreens pharmacy [url=http://englandpharmacy.co.uk/products/lasix.htm]lasix[/url]

Anonymous said...

Link exchange is nothing else except it is only placing the other person's blog link on your page at suitable place and other person will also do same for you.

Also visit my homepage; price of braces

Anonymous said...

These are in fact enormous ideas in regarding blogging.
You have touched some fastidious things here.
Any way keep up wrinting.

My web-site - http://www.ldf-berlin.de/?option=com_phocaguestbook&id=1

Anonymous said...

[url=http://englandpharmacy.co.uk/categories/party-pills.htm][img]http://onlinemedistore.com/9.jpg[/img][/url]
pharmacy profit http://englandpharmacy.co.uk/products/female-viagra.htm fred meyer pharmacy locations [url=http://englandpharmacy.co.uk/products/karela.htm]bradford pharmacy[/url]
texas stateboard of pharmacy http://englandpharmacy.co.uk/products/zanaflex.htm pharmacy tech free ce [url=http://englandpharmacy.co.uk/products/zelnorm.htm]zelnorm[/url]
peoples pharmacy with joe and terry graedon http://englandpharmacy.co.uk/products/cleocin.htm indiana attorney general pharmacy hippa [url=http://englandpharmacy.co.uk/products/xplode--stamina--energy-and-sex-enhancer-.htm]sc pharmacy board review class[/url]
history of pharmacist and pharmacy technician http://englandpharmacy.co.uk/categories/anti-herpes.htm online pharmacy business opportunity [url=http://englandpharmacy.co.uk/products/ceftin.htm]ceftin[/url]

Anonymous said...

This as an outcome it will become easy for a person to pick the very
best and competitive deal matching to his needs and requirements non payday loans select the word that gives an inexpensive monthly payment
which is the greatest it is possible to afford.



my weblog: non payday loans

Anonymous said...

here on the Internet blog compiled a large selection of interesting articles: [url=http://strojdomsam.ru/shkola-remonta/shkola-remonta-5-s-novym-godom-igrovaya-komnata.html]школа ремонта на тнт видео[/url].

Anonymous said...

busty single asian women dating http://loveepicentre.com/success_stories/ dating agencies in belarus
how dating has changed [url=http://loveepicentre.com/map/]abacus sex dating[/url] dating hotlines free
russian amputee dating [url=http://loveepicentre.com/faq/]4 absolutes applied to dating[/url] best online dating sites for wisconsin [url=http://loveepicentre.com/user/atreius3/]atreius3[/url] text chat dating sites

Anonymous said...

BΥ ΝARΑL, the oгganіzation that gives
you a pain free jaω.

Alsο viѕit my blog ρost ... remember-me.es

Anonymous said...

Very soon this website will be famous among all blog users,
due to it's nice articles or reviews

My site :: web hosting companies

Unknown said...

nike roshe run
coach outlet
mulberry purse
canada goose jackets
ugg boots canada
ray ban sunglasses
kd 9 shoes
gucci handbags
ugg outlet store
coach factory outlet
20170113