<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3109214023915898482</id><updated>2011-12-05T10:19:11.534-08:00</updated><title type='text'>welcome to SAS world</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>56</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-1869557202124771656</id><published>2008-03-28T00:42:00.000-07:00</published><updated>2008-03-28T00:43:34.291-07:00</updated><title type='text'>SAS Clinical Trials</title><content type='html'>&lt;a href="http://sas9.blogspot.com/2008/01/clinical-trials-terminology-for-sas.html"&gt;Clinical  Trials Terminology for SAS Programmers&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www2.sas.com/proceedings/sugi29/151-29.pdf"&gt;Clinical Trial Online –  Running SAS on the Web without SAS/IntrNet&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.lexjansen.com/pharmasug/2006/datamanagement/dm08.pdf"&gt;Managing  Clinical Trials Data using SAS® Software&lt;/a&gt;&lt;br /&gt;&lt;a href="http://sas9.blogspot.com/2007/12/clinical-trails.html"&gt;Clinical Trails  &lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.pharmanet.com/pdf/whitepapers/QCQA.pdf"&gt;Quality  Control and Quality Assurance in Clinical Research: SAS&lt;br /&gt;Everything we should  know about ICH, GCP and their Guidelines&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.lexjansen.com/wuss/2005/sas_solutions/sol_data_integrity_through.pdf"&gt;Data  Integrity through DEFINE.PDF and DEFINE.XML&lt;/a&gt;&lt;br /&gt;&lt;a href="http://sas9.blogspot.com/2007/12/sas-and-clinical-data-interchange.html"&gt;SAS®  and the CDISC (Clinical Data Interchange Standards Consortium)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.lexjansen.com/phuse/2005/cd/cd02.pdf"&gt;An Introduction to  CDISC:&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.lexjansen.com/pharmasug/2003/fdacompliance/fda055.pdf"&gt;CDISC:  Why SAS® Programmers Need to Know &lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.lexjansen.com/pharmasug/2006/handsonworkshops/hw06.pdf"&gt;CDISC  Implementation Step by Step: A Real World Example&lt;br /&gt;&lt;/a&gt;&lt;a href="http://www.cdisc.org/standards/index.html"&gt;CDISC standards&lt;/a&gt;&lt;br /&gt;&lt;a href="www.bms-aned.nl/dnn/Portals/0/PSDM/Presentation%20M.%20Lambrecht.ppt"&gt;Supporting  the CDISC standards&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.cdisc.org/pdf/P061.pdf"&gt;How to  test CDISC Operation data Model (ODM) in SAS&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www2.sas.com/proceedings/forum2007/158-2007.pdf"&gt;Can Coding MedDRA  and WHO Drug be as Easy as a Google Search? &lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.lexjansen.com/pharmasug/2007/sas/sa05.pdf"&gt;The Use of CDISC  Standards in SAS from Data Capture to Reporting&lt;br /&gt;&lt;/a&gt;&lt;a href="Clinical%20Data%20Model%20and%20FDA/CDISC%20Submissions"&gt;Clinical  Data Model and FDA/CDISC Submissions&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.dataceutics.com/papers/AD12.pdf"&gt;Implementing an Audit Trail  within a Clinical Reporting Tool&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Annotation of CRFs:&lt;br /&gt;&lt;a href="http://sas9.blogspot.com/2007/12/demographics-dmecrf-builder-created.html"&gt;Trial  eCRF Pages&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.lexjansen.com/pharmasug/2004/coderscorner/cc02.pdf"&gt;Using SAS  to Speed up Annotating Case Report Forms in PDF Format&lt;/a&gt;&lt;br /&gt;&lt;a href="http://ssc.utexas.edu/docs/sashelp/sugi/24/AppDevel/p09-24.pdf"&gt;ANNOTATED  CASE REPORT FORM AUTOMATION SYSTEM&lt;/a&gt;&lt;br /&gt;Annotated CRF 1: Download&lt;br /&gt;&lt;a href="http://www.ctndatashare.org/studies/NIDA-CTN-0008/annotated-crf/attachment_download/file"&gt;(CTN0008_SDTM_annotation_20070413.pdf  - 2179Kb) &lt;/a&gt;&lt;br /&gt;Annotated CRF 2: Download&lt;br /&gt;&lt;a href="http://www.ctndatashare.org/studies/NIDA-CTN-0001/annotated-crf-1/attachment_download/file"&gt;(CTN001_SDTM_ANNOTATION_20070330.pdf  - 564Kb) &lt;/a&gt;&lt;br /&gt;Annotated CRF 3: Download&lt;br /&gt;&lt;a href="http://www.ctndatashare.org/studies/NIDA-CTN-0002/annotated-crf-1/attachment_download/file"&gt;(CTN002_SDTM_ANNOTATION_20070403.pdf  - 560Kb) &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Study  Protocol 1: Download&lt;br /&gt;&lt;a href="http://www.ctndatashare.org/studies/NIDA-CTN-0001/ctn-001-protocol/attachment_download/file"&gt;(NIDA-CTN-0001_Bup_Nx_vs_Clonidine_Inpatient_Protocol_v.5b_112700.pdf  - 192Kb) &lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.xml4pharma.com/CDISC_Products/#SDTM"&gt;SDTM-annotated  CRFs&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.xml4pharma.com/CDISC_Products/ODMDesigner_User_manual.pdf"&gt;The  CDISC ODM Study Designer :User Manual&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www2.sas.com/proceedings/sugi25/25/ad/25p031.pdf"&gt;Creating Case  Report Tabulations (CRTs) for an NDA Electronic Submission to the FDA &lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.lexjansen.com/pharmasug/2005/posters/po08.pdf"&gt;XML Basics for  SAS Programmers&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.lexjansen.com/pharmasug/2003/posters/p111.pdf"&gt;A SAS MACRO FOR  PRODUCING CLINICAL LABORATORY SHIFT TABLE&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.lexjansen.com/pharmasug/2005/posters/po40.pdf"&gt;Some Statistical  Programming Considerations for e-Submission &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-1869557202124771656?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/1869557202124771656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=1869557202124771656' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1869557202124771656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1869557202124771656'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2008/03/sas-clinical-trials.html' title='SAS Clinical Trials'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-5118338647618183818</id><published>2008-01-26T03:56:00.000-08:00</published><updated>2008-01-26T04:31:51.553-08:00</updated><title type='text'>SAS Programming</title><content type='html'>Base and Advanced SAS Programming:&lt;br /&gt;&lt;a href="http://sas9.blogspot.com/2007/12/base-sas-certification-exam-questions.html"&gt;Base SAS Certification Exam Model Questions:&lt;/a&gt;&lt;br /&gt; &lt;a href="http://www2.sas.com/proceedings/sugi30/149-30.pdf"&gt;SAS® Certification: An End User’s Review&lt;/a&gt;&lt;br /&gt;How SAS thinks&lt;br /&gt;&lt;a href="http://www2.sas.com/proceedings/sugi30/149-30.pdf"&gt;SAS Procedures Guide&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.kellogg.northwestern.edu/researchcomputing/docs/SAS_Programming_Skills.pdf"&gt;SAS Programming Skills&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www2.sas.com/proceedings/forum2007/026-2007.pdf"&gt;Affordable SAS tips&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www2.sas.com/proceedings/forum2007/026-2007.pdf"&gt;Advanced SAS Programming Techniques&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug98/p067.pdf"&gt;Creative Uses of SAS Functions&lt;/a&gt;&lt;br /&gt;&lt;a href="http://analytics.ncsu.edu/sesug/1999/054.pdf"&gt;Data Summarization Methods in Base SAS Procedures&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.codecraftersinc.com/pdf/Debugging.pdf"&gt;The SAS Debugging Primer&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.codecraftersinc.com/pdf/Debugging.pdf"&gt;SAS Model resumes and SAS Tips and Tricks&lt;/a&gt;&lt;br /&gt;&lt;a href="http://sas9.blogspot.com/2007/12/sas-unix-tutorials.html"&gt;SAS UNIX commands:&lt;/a&gt;&lt;br /&gt; &lt;a href="http://wiki.binghamton.edu/index.php/Concise_Glossary_for_SAS"&gt;SAS statements,Procedures and Functions&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.cpc.unc.edu/services/computer/presentations/sasclass99/merge.html"&gt;Introduction to merging in SAS&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/STAT/sas/library/nesug99/ad155.pdf"&gt;How MERGE Really Works&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.pauldickman.com/teaching/sas/set_by.php"&gt;FIRST.variable and LAST.variables:&lt;/a&gt;&lt;br /&gt;Proc Report and Proc Tabulate&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sas9.blogspot.com/2008/01/index.html"&gt;Downloads&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;SAS eBOOKs&lt;br /&gt;Base and Avanced SAS certification Materials and Practice&lt;br /&gt; Exams...........&lt;br /&gt;&lt;br /&gt;SAS Video Tutorials:&lt;br /&gt;Class Notes&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/notes2/entering.htm"&gt;Entering Data&lt;/a&gt;, view &lt;a href="http://www.ats.ucla.edu/stat/sas/notes2/movies/IntroSAS1.html"&gt;movie&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/notes2/exploring.htm"&gt;Exploring Data&lt;/a&gt;, view &lt;a href="http://www.ats.ucla.edu/stat/sas/notes2/movies/IntroSAS2.html"&gt;movie&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/notes2/modifying.htm"&gt;Modifying Data&lt;/a&gt;, view &lt;a href="http://www.ats.ucla.edu/stat/sas/notes2/movies/IntroSAS3.html"&gt;movie&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/notes2/managing.htm"&gt;Managing Data&lt;/a&gt;, view &lt;a href="http://www.ats.ucla.edu/stat/sas/notes2/movies/IntroSAS4.html"&gt;movie&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/notes2/analyze.htm"&gt;Analyzing Data&lt;/a&gt;, view &lt;a href="http://www.ats.ucla.edu/stat/sas/notes2/movies/IntroSAS5a.html"&gt;movie (part 1)&lt;/a&gt; and &lt;a href="http://www.ats.ucla.edu/stat/sas/notes2/movies/IntroSAS5b.html"&gt;movie (part 2)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Data step:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/windows/windows.html"&gt;getting started 1: windows&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/windows.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20step/data%20step.html"&gt;getting started 2: data step&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/mine0.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/auto_N_/auto_N_.html"&gt;automatic _N_ variable&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/auto_N_.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/drop_delete/drop_delete.html"&gt;drop &amp;amp; delete&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/drop_delete.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/format/format.html"&gt;formating: dates and numbers&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/date_sal.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/date%20sal.txt"&gt;date sal.txt&lt;/a&gt; (also see the format procedure below to create your own formats)&lt;a href="http://dist.stat.tamu.edu/flash/SAS/functions/functions.html"&gt;functions&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/functions.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/excel/excel.html"&gt;import: Bringing in data from Excel&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/excel.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/excel.xls"&gt;Excel import file&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/exporting.xls"&gt;Excel export file&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/excel.txt"&gt;text file&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/input/input.html"&gt;input&lt;/a&gt;: length statement &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/employees.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/infile%20options.txt"&gt;infile options.txt&lt;/a&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/long/long.html"&gt;long&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/delimiter.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/long.txt"&gt;long.txt&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/missing/missing.html"&gt;missing data&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/missing%20data.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/output/output.html"&gt;output option&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/drop_delete.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/pointers/pointers.html"&gt;pointers&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/6360%20June%2013_ex7,8,9,10.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/6360%20June%2013_ex7.txt"&gt;ex7.txt&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/6360%20June%2013_ex8.txt"&gt;ex8.txt&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/6360%20June%2013_ex9.txt"&gt;ex9.txt&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/morepointers/morepointers.html"&gt;more about pointers&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/6360%20June%2013_ex7,8,9,10.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/pointers.sas"&gt;pointers.SAS&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/6360%20June%2013_ex10.txt"&gt;ex10.txt&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/mvr_dlm/mvr_dlm.html"&gt;missover &amp;amp; delimiter&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/delimiter.sas"&gt;SAS code &lt;/a&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/delimiter.txt"&gt;delimiter.txt&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/dlm/dlm.html"&gt;more on the delimiter&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/delimiter.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/retain/retain.html"&gt;retain&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/retain.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/set/set.html"&gt;set&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/set%20statement.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/sim/sim.html"&gt;simulations:&lt;/a&gt; random numbers &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/random%20numbers.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/sum/sum.html"&gt;sum&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/drop_delete.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/statprobfns/statprobfns.html"&gt;statistical functions&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/statprobfns.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Logic:&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/do/do.html"&gt;do loops&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/do.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/moredo/moredo.html"&gt;more about do loops&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/nestdo.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/nestdo/nestdo.html"&gt;nested do loops&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/nestdo.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/if_then/if_then.html"&gt;if then statements&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/if_then.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/score.txt"&gt;score.txt&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Combining Data sets:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/concatenate/concatenate.html"&gt;concatenating and interleaving&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/concat.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/one2one_merge/one2one_merge.html"&gt;one-to-one merging&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/merge.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/match_merge/match_merge.html"&gt;match merging&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/match%20merging.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/update/update.html"&gt;updating&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/update.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Character functions:&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/substr/substr.html"&gt;substring function&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/substr.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/trim/trim.html"&gt;trim and left functions&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/substr.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/compress_index/compress_index.html"&gt;compress and index functions&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/compress_index.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/record.txt"&gt;record.txt&lt;/a&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/indexc_w/indexc_w.html"&gt;indexc and indexw functions&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/compress_index.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/convert_i/convert_i.html"&gt;implicit character-to-numeric conversion&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/convert.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/convert_e/convert_e.html"&gt;explicit character-to-numeric conversion&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/convert_e.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/convert_numtochar/convert_numtochar.html"&gt;implicit and explicit numeric-to-character conversion&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/numtochar.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Arrays:&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/array1/array1.html"&gt;introduction to arrays&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/array1.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/array2/array2.html"&gt;using arrays to count&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/array2.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/array3/array3.html"&gt;using arrays to order observations&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/array3.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/arrayrats/arrayrats.html"&gt;using arrays to transpose data&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/rats.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/ratsdose.txt"&gt;ratsdose.txt&lt;/a&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/array2d/array2d.html"&gt;two dimensional arrays&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/array2d.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/temp.txt"&gt;temp.txt&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/fin.txt"&gt;fin.txt&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Permanent SAS Data sets: (great for large data sets)&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/perm1/perm1.html"&gt;introduction&lt;/a&gt;: using libname &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/permanent%20data.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/put_file/put_file.html"&gt;put and file statements&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/permanent%20data.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/survey.dat"&gt;survey.dat&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/data1.dat"&gt;data1.dat&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/data2.dat"&gt;data2.dat&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/data3.txt"&gt;data3.txt&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/fruit.dat"&gt;fruit.dat&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/data4.dat"&gt;data4.dat&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/data5.dat"&gt;data5.dat&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/income.dat"&gt;income.dat&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Procedures:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/anova/anova.html"&gt;ANOVA&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/reg_etc.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/incommed.dat"&gt;incommed.dat&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/equal_vars/equal_vars.html"&gt;analysis of equal vars&lt;/a&gt;: B-P for anova &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/test_equal_vars.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/contents/contents.html"&gt;contents: Great for large data sets&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/contents.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/sheep.dat"&gt;sheep.dat&lt;/a&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/corr/corr.html"&gt;correlation&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/corr.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/excel/excel.html"&gt;import: Bringing in data from Excel&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/excel.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/excel.xls"&gt;Excel import file&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/exporting.xls"&gt;Excel export file&lt;/a&gt;&lt;br /&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/excel.txt"&gt;text file&lt;/a&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/proc_format/proc_format.html"&gt;format&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/format.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/incommed.dat"&gt;incommed.dat&lt;/a&gt; (also see formating above for SAS' date and number formats)&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/freq/freq.html"&gt;frequency tables&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/freq.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/incommed.dat"&gt;incommed.dat&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/freq.xls"&gt;freq.xls&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/means/means.html"&gt;means&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/means.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/incommed.dat"&gt;incommed.dat&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/moremeans/moremeans.html"&gt;more about means&lt;/a&gt; SA&lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/means.sas"&gt;S code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/incommed.dat"&gt;incommed.dat&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/bar_pie_charts/bar_pie_charts.html"&gt;gcharts: Bar and Pie charts&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/incommed.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/incommed.dat"&gt;incommed.dat&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/gplot/gplot.html"&gt;gplot: a prettier plot&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/plot.sas"&gt;SAS code &lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/moregplot/moregplot.html"&gt;more about gplot&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/moregplot.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/plot/plot.html"&gt;plot&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/plot.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/print/print.html"&gt;print&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/print.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/account.txt"&gt;account.txt&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/sort/sort.html"&gt;sort&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/sort.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/account.txt"&gt;account.txt&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/moresort/moresort.html"&gt;more about sorting&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/sort2.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/compt.txt"&gt;compt.txt&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/ttest/ttest.html"&gt;t-test&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/reg_etc.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/incommed.dat"&gt;incommed.dat&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/transpose/transpose.html"&gt;transpose&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/transpose.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/univariate/univariate.html"&gt;univariate&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/univariate.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/test.dat"&gt;test.dat&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Programming outside the Data step or Procedures:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/options/options.html"&gt;Getting started 3: options&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/mine0.sas"&gt;SAS code&lt;/a&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/moreoptions/moreoptions.html"&gt;more options&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/options.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Macros:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/intro_macro/intro_macro.html"&gt;introduction&lt;/a&gt;: macro variables (%let statement) &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/macro_intro.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/number.dat"&gt;number.dat&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/contest.dat"&gt;contest.dat&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/put_macro/put_macro.html"&gt;%put statement&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/put%20statement.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/score.dat"&gt;score.dat&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/macro_basic/macro_basic.html"&gt;basic macros&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/more%20macros.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/macro_parms/macro_parms.html"&gt;macros with parameters&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/macros%20with%20arguments.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/ranks.dat"&gt;ranks.dat&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/macro_do/macro_do.html"&gt;macro do loops&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/macro%20do%20loops.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/macro_if_then/macro_if_then.html"&gt;macro if/then/else statements&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/macro%20if%20then%20else.sas"&gt;SAS code&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/makeup.dat"&gt;makeup.dat&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/macro_nest/macro_nest.html"&gt;nested macros&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/nestmacro.sas"&gt;SAS code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/macro_sims/macro_sims.html"&gt;simulations example&lt;/a&gt; &lt;a href="http://dist.stat.tamu.edu/flash/SAS/sas%20code/macros%20&amp;amp;%20random%20numbers.sas"&gt;SAS code &lt;/a&gt;&lt;a href="http://dist.stat.tamu.edu/flash/SAS/data%20sets/reg.dat"&gt;reg.dat&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Online Study maerials:Fundamentals of Using SAS (part I)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/intsas.htm"&gt;Introduction to SAS&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/descript.htm"&gt;Descriptive information and statistics&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/stats.htm"&gt;An overview of statistical tests in SAS&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/graph.htm"&gt;Exploring data with graphics&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Fundamentals of Using SAS (part II)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/where.htm"&gt;Using where with SAS procedures&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/missing.htm"&gt;Missing values in SAS&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/options.htm"&gt;Common SAS options&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/syntax.htm"&gt;Overview of SAS syntax of SAS procedures &lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/errors.htm"&gt;Common error messages in SAS&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Reading Raw Data into SAS&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/input.htm"&gt;Inputting raw data into SAS&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/dates.htm"&gt;Reading dates into SAS and using date variables&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Basic Data Management in SAS&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/vars.htm"&gt;Creating and recoding variables&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/funct.htm"&gt;Using SAS functions for making/recoding variables&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/subset.htm"&gt;Subsetting variables and observations&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/labels.htm"&gt;Labeling data, variables, and values&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/sort.htm"&gt;Using PROC SORT and the BY statement&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/modules/sasfilesv8.htm"&gt;Making and using permanent SAS data files (version 8)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Data Management:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/sk/faq_sk.htm"&gt;&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/randid.htm"&gt;How do I make unique anonymous ID variables for my data?&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/sk/faq_sk.htm"&gt;&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/enumerate.htm"&gt;How can I create an enumeration variable by groups?&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/sk/faq_sk.htm"&gt;&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/nummiss_sas.htm"&gt;How can I see the number of missing values and patterns of missing values in my data file?&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/sk/faq_sk.htm"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/cnt_charmiss.htm"&gt;How can I count the number of missing values for a character variable?&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/sk/faq_sk.htm"&gt;&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/increment_dates.htm"&gt;How can I increment dates in SAS?&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/sk/faq_sk.htm"&gt;&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/index_function.htm"&gt;How can I find things in a character variable in SAS?&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/sk/faq_sk.htm"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/standard.htm"&gt;How do I standardize variables (make them have a mean of 0 and sd of 1)?&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/sk/faq_sk.htm"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/dumvars.htm"&gt;Is there a quick way to create dummy variables?&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/sk/faq_sk.htm"&gt; &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Reading/Writing Data Files&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/readdelim8.htm"&gt;How do I read a file that uses commas, tabs or spaces as delimiters to separate variables?&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/readdsd.htm"&gt;How do I read a delimited file with missing values?&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/readdsd2.htm"&gt;How do I read a delimited file that has delimiters embedded in the data?&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/InfileOptions_ut.htm"&gt;What are some common infile options for reading a raw data file? &lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/readgz.htm"&gt;How do I read raw data files compressed with gzip (.gz files) in SAS?&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/writedelim8.htm"&gt;How do I write a data file that uses commas, tabs or spaces as delimiters between variables?&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/rwxls8.htm"&gt;How do I read/write Excel files in SAS version 8?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Reading/Writing SAS Files with Formats&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/readfmt.htm"&gt;How do I use a SAS data file with a format library?&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/nofmterr.htm"&gt;How do I use a SAS data file when I don't have its format library?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Other:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/format.htm"&gt;How can I change the way variables are displayed in proc freq?&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/macro_symput.htm"&gt;How can I put a value from a data file to a macro variable?&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/faq/tabulate.htm"&gt;How can I create tables using proc tabulate?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Procedures&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug00/p068.pdf"&gt;PROC MEANS More than just your average procedure&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Peter R. Welbrock&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug00/bt3001.pdf"&gt;The power of PROC FORMAT&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Jonas V. Bilenas&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug00/bt3014.pdf"&gt;Ten Things You Should Know About PROC FORMAT&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Jack Shoemaker&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug99/ad121.pdf"&gt;PROC SQL for DATA Step Die-Hards&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Christianna S. Williams&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug99/bt082.pdf"&gt;An Introduction to the SQL Procedure&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Chris Yindra&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug99/bt150.pdf"&gt;Alternatives to Merging SAS Data Sets … But Be Careful&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Michael J. Wieczkowski&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug98/p004.pdf"&gt;Handling Missing Values in the SQL Procedure&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Danbo Yi &amp;amp; MA Lei Zhang&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/index.htm"&gt;Creating and using indexes in SAS&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/formats.htm"&gt;Creating and using formats and format libraries in SAS&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/multidimensional_arrays.htm"&gt;Using multidimensional arrays&lt;/a&gt;Good Programming Practices&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug00/ad1006.pdf"&gt;Bulletproofing Your SAS Results&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Vanessa Hayden&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug00/ap2004.pdf"&gt;Clean-up, Comments and Code - Making it Maintainable&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Clay and Lori Martin&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug00/bt3005.pdf"&gt;SAS Program Efficiency for Beginners&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Bruce Gilsen&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug98/p131.pdf"&gt;Coding for Posterity&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug00/bt3005.pdf"&gt;&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Rick AsterOutput Delivery System(ODS)&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug00/bt3010.pdf"&gt;ODS, YES! Odious, NO! – An Introduction to the SAS Output Delivery System&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Lara Bryant, Sally Muller &amp;amp; Ray Pass&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/ods.pdf"&gt;ODS for Data Analysis: Output As-You-Like-It in Version 7&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Christopher R. Olinger and Randall D. Tobias, from SUGI Proceedings, 1998, courtesy of&lt;br /&gt;&lt;a href="http://www.sas.com/"&gt;SAS&lt;/a&gt;.&lt;a href="http://www.ats.ucla.edu/stat/sas/library/ods_work_for_you.pdf"&gt;Making the SAS Output Delivery System (ODS) work for you&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by William Fehlner, from SUGI Proceedings, 1999, courtesy of &lt;a href="http://www.sas.com/"&gt;SAS&lt;/a&gt;.&lt;a href="http://www.ats.ucla.edu/stat/sas/library/ods_templates.pdf"&gt;Twisty Little Passages All Alike, Output Delivery System (ODS) Templates Exposed&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Chris Olinger, from SUGI Proceedings, 1999, courtesy of &lt;a href="http://www.sas.com/"&gt;SAS&lt;/a&gt;.SAS Macros&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug99/bt046.pdf"&gt;Getting Started with Macros&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Ian Whitlock&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug00/bt3012.pdf"&gt;Moving from Macro Variables to Macros&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Lisa Sanbonmatsu&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug99/bt066.pdf"&gt;Macros from Beginning to Mend A Simple and Practical Approach to the SAS Macro Facility&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Michael G. Sadof&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug99/bt108.pdf"&gt;An Introduction to Macro Variables and Macro Programs&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Mike S. Zdeb&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug99/cc107.pdf"&gt;Creating Macro Variables via PROC SQL&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Mike S. Zdeb&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug98/p193.pdf"&gt;More About “INTO:Host-Variable” in PROC SQL: Examples&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug99/cc107.pdf"&gt;&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by John Q. Zhang&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug99/ad088.pdf"&gt;Macro Quoting Functions, Other Special Character Masking Tools, and How To Use Them&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Arthur L. Carpenter&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug99/bt185.pdf"&gt;Secrets of Macro Quoting Functions – How and Why&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Susan O’Connor&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug98/p086.pdf"&gt;&amp;amp;&amp;amp;&amp;amp;, ;;, and Other Hieroglyphics Advanced Macro Topics&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Chris Yindra, C. YPROC SQL:&lt;br /&gt;&lt;a href="http://www2.sas.com/proceedings/sugi27/p191-27.pdf"&gt;An Introduction to Proc Sql&lt;/a&gt;&lt;a href="http://www2.sas.com/proceedings/sugi29/042-29.pdf"&gt;Top Ten Reasons to Use PROC SQL &lt;/a&gt;Other&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug98/p107.pdf"&gt;Debugging 101&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Peter Knapp&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug99/bt115.pdf"&gt;Those Missing Values in Questionnaires&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by John R. Gerlach &amp;amp; Cindy Garra&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug00/bt3008.pdf"&gt;Avoiding Mayhem in the New Millennium: Working with Missing Data&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by JoAnn Matthews&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug98/p141.pdf"&gt;Simplifying Complex Character Comparisons by Using the IN Operator and the Colon (:) Operator Modifier&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Paul Grant&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug00/bt3013.pdf"&gt;Arrays: In and Out and All About&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Marge Scerbo&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug00/bt3009.pdf"&gt;Complex Arrays Made Simple&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Mary McDonald, PaineWebber Incorporated&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug00/bt3004.pdf"&gt;You Could Look It Up: An Introduction to SASHELP Dictionary Views&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Michael Davis, &lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug98/p142.pdf"&gt;The 'SKIP' Statement&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) by Paul Grant&lt;br /&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/library/nesug00/ad1007.pdf"&gt;Indexing and Compressing SAS Data Sets: How, Why, and Why Not&lt;/a&gt;(&lt;a href="http://www.adobe.com/prodindex/acrobat/readstep.html"&gt;PDF&lt;/a&gt;) Andrew H. Karp,courtesy of &lt;a href="http://www.nesug.org/"&gt;NESUG&lt;/a&gt;SAS Online Documentation:SAS 9 DocumentationVersion 9.1.3&lt;br /&gt;&lt;br /&gt;&lt;a href="http://support.sas.com/onlinedoc/913/docMainpage.jsp"&gt;SAS OnlineDoc 9.1.3 for the Web&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/glimmix.pdf"&gt;Proc Glimmix&lt;/a&gt;&lt;a href="http://www.ats.ucla.edu/stat/sas/quantreg.pdf"&gt;Proc Quantreg&lt;/a&gt;Version 9.1.2&lt;a href="http://support.sas.com/onlinedoc/912/"&gt;SAS OnlineDoc 9.1.2 for the Web&lt;/a&gt;Version 9.1&lt;a href="http://support.sas.com/91doc/"&gt;SAS OnlineDoc 9.1 for the Web&lt;/a&gt;&lt;a href="http://support.sas.com/documentation/onlinedoc/91pdf/index.html"&gt;SAS OnlineDoc 9.1 in PDF&lt;/a&gt;Clinical trials:&lt;a href="http://sas9.blogspot.com/2008/01/clinical-trials-terminology-for-sas.html"&gt;Clinical Trials Terminology for SAS Programmers&lt;/a&gt;&lt;a href="http://www2.sas.com/proceedings/sugi29/151-29.pdf"&gt;Clinical Trial Online – Running SAS on the Web without SAS/IntrNet&lt;/a&gt;&lt;a href="http://www.lexjansen.com/pharmasug/2006/datamanagement/dm08.pdf"&gt;Managing Clinical Trials Data using SAS® Software&lt;/a&gt;&lt;a href="http://sas9.blogspot.com/2007/12/clinical-trails.html"&gt;Clinical Trails &lt;/a&gt;&lt;a href="http://sas9.blogspot.com/2007/12/demographics-dmecrf-builder-created.html"&gt;Trial eCRF Pages&lt;/a&gt;&lt;a href="http://sas9.blogspot.com/2007/12/everything-we-should-know-about-ich-and.html"&gt;Everything we should know about ICH, GCP and their Guidelines&lt;/a&gt;&lt;a href="http://sas9.blogspot.com/2007/12/sas-and-clinical-data-interchange.html"&gt;SAS® and the CDISC (Clinical Data Interchange Standards Consortium)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;SUGI Papers:&lt;br /&gt;&lt;br /&gt; &lt;a href="http://www.sas.com/usergroups/sugi/proceedings/index.html"&gt;SUGI Proceedings&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;for SUGI &lt;a href="http://www2.sas.com/proceedings/sugi22/PROCEED.PDF"&gt;22&lt;/a&gt;, &lt;a href="http://www2.sas.com/proceedings/sugi23/Proceed.pdf"&gt;23&lt;/a&gt;, &lt;a href="http://www2.sas.com/proceedings/sugi24/Proceed.pdf"&gt;24&lt;/a&gt;, &lt;a href="http://www2.sas.com/proceedings/sugi25/PROCCED.pdf"&gt;25&lt;/a&gt;, &lt;a href="http://www2.sas.com/proceedings/sugi26/proceed.pdf"&gt;26&lt;/a&gt;, &lt;a href="http://www2.sas.com/proceedings/sugi27/Proceed27.pdf"&gt;27&lt;/a&gt;&lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sgf2008&amp;amp;s=sugi_next&amp;amp;c=sugi"&gt;SGF 2008&lt;/a&gt; &lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sgf2007&amp;amp;s=sugi&amp;amp;c=sugi"&gt;SGF 2007&lt;/a&gt; &lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sugi31&amp;amp;s=sugi&amp;amp;c=sugi"&gt;SUGI 31&lt;/a&gt; &lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sugi30&amp;amp;s=sugi&amp;amp;c=sugi"&gt;SUGI 30&lt;/a&gt; &lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sugi29&amp;amp;s=sugi&amp;amp;c=sugi"&gt;SUGI 29&lt;/a&gt; &lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sugi28&amp;amp;s=sugi&amp;amp;c=sugi"&gt;SUGI 28&lt;/a&gt; &lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sugi27&amp;amp;s=sugi&amp;amp;c=sugi"&gt;SUGI 27&lt;/a&gt; &lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sugi26&amp;amp;s=sugi&amp;amp;c=sugi"&gt;SUGI 26&lt;/a&gt;&lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sugi25&amp;amp;s=sugi&amp;amp;c=sugi"&gt;SUGI 25&lt;/a&gt; &lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sugi24&amp;amp;s=sugi&amp;amp;c=sugi"&gt;SUGI 24&lt;/a&gt; &lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sugi23&amp;amp;s=sugi&amp;amp;c=sugi"&gt;SUGI 23&lt;/a&gt; &lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sugi22&amp;amp;s=sugi&amp;amp;c=sugi"&gt;SUGI 22&lt;/a&gt; &lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sugi21&amp;amp;s=sugi&amp;amp;c=sugi"&gt;SUGI 21&lt;/a&gt; &lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sugi20&amp;amp;s=sugi&amp;amp;c=sugi"&gt;SUGI 20&lt;/a&gt; &lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sugi13&amp;amp;s=sugi&amp;amp;c=sugi"&gt;SUGI 13&lt;/a&gt; &lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sugi12&amp;amp;s=sugi&amp;amp;c=sugi"&gt;SUGI 12&lt;/a&gt; &lt;a href="http://www.lexjansen.com/cgi-bin/xsl_transform.asp?x=sugi09&amp;amp;s=sugi&amp;amp;c=sugi"&gt;SUGI 09&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;SAS Forums/Groups:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.tek-tips.com/threadminder.cfm?pid=376" target="_blank"&gt;Tek-Tip SAS Forum&lt;/a&gt;&lt;a href="http://www.indeed.com/forum/cmp/SAS.html" target="_blank"&gt;Indeed&lt;/a&gt;&lt;a href="http://www.mydatabasesupport.com/forums/olap/162178-sas-enterprise-miner.html" target="_blank"&gt;DBASpot&lt;/a&gt;&lt;a href="http://forums.devshed.com/other-programming-languages-139/sas-programming-359974.html" target="_blank"&gt;SAS Programming Forum&lt;/a&gt;&lt;a href="http://www.itilcommunity.com/modules.php?name=Forums&amp;amp;file=viewtopic&amp;amp;p=6896"&gt;ITIL Community Forum&lt;/a&gt;&lt;a title="Edit Post" href="http://www.blogger.com/post-edit.g?blogID=111189970479192877&amp;amp;postID=1304660161420556348"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-5118338647618183818?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/5118338647618183818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=5118338647618183818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/5118338647618183818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/5118338647618183818'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2008/01/sas-programming.html' title='SAS Programming'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-5352973551153864668</id><published>2008-01-26T03:23:00.000-08:00</published><updated>2008-06-24T19:54:42.189-07:00</updated><title type='text'>SAS Interview Questions:Base SAS</title><content type='html'>&lt;strong&gt;· What SAS statements would you code to read an external raw data file to a DATA step?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;INFILE statement.·&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How do you read in the variables that you need?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Using Input statement with the column pointers like @5/12-17 etc.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· Are you familiar with special input delimiters? How are they used?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;DLM and DSD are the delimiters that I’ve used. They should be included in the infile statement. Comma separated values files or CSV files are a common type of file that can be used to read with the DSD option. DSD option treats two delimiters in a row as MISSING value. DSD also ignores the delimiters enclosed in quotation marks.&lt;br /&gt;&lt;br /&gt;·&lt;strong&gt; If reading a variable length file with fixed input, how would you prevent SAS from reading the next record if the last variable didn't have a value?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;By using the option MISSOVER in the infile statement.If the input of some data lines are shorter than others then we use TRUNCOVER option in the infile statement.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· What is the difference between an informat and a format? Name three informats or formats.Informats read the data.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Format is to write the data.Informats: comma. dollar. date.Formats can be same as informatsInformats: MMDDYYw. DATEw. TIMEw. , PERCENTw,Formats: WORDIATE18., weekdatew.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Name and describe three SAS functions that you have used, if any?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;LENGTH: returns the length of an argument not counting the trailing blanks.(missing values have a length of 1)&lt;br /&gt;Ex: a=’my cat’;x=LENGTH(a);&lt;br /&gt;&lt;br /&gt;Result: x=6…SUBSTR: SUBSTR(arg,position,n) extracts a substring from an argument starting at ‘position’ for ‘n’ characters or until end if no ‘n’.&lt;br /&gt;Ex: A=’(916)734-6241’;X=SUBSTR(a,2,3);&lt;br /&gt;&lt;br /&gt;RESULT: x=’916’TRIM: removes trailing blanks from character expression.&lt;br /&gt;Ex: a=’my ‘; b=’cat’;X= TRIM(a)(b);&lt;br /&gt;RESULT: x=’mycat’.&lt;br /&gt;SUM: sum of non missing values.Ex: x=Sum(3,5,1);&lt;br /&gt;result: x=9.0INT:&lt;br /&gt;Returns the integer portion of the argument.&lt;br /&gt;&lt;br /&gt;·&lt;strong&gt; How would you code the criteria to restrict the output to be produced?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Use NOPRINT option.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· What is the purpose of the trailing @ and the @@? How would you use them?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;@ holds the value past the data step.@@ holds the value till a input statement or end of the line.Double trailing @@: When you have multiple observations per line of raw data, we should use double trailing signs (@@) at the end of the INPUT statement. The line hold specifies like a stop sign telling SAS, “stop, hold that line of raw data”.Trailing @: By using @ without specifying a column, it is as if you are telling SAS,” stay tuned for more information. Don’t touch that dial”. SAS will hold the line of data until it reaches either the end of the data step or an INPUT statement that does not end with the trailing.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· Under what circumstances would you code a SELECT construct instead of IF statements?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;When you have a long series of mutually exclusive conditions and the comparison is numeric, using a SELECT group is slightly more efficient than using IF-THEN or IF-THEN-ELSE statements because CPU time is reduced.&lt;br /&gt;SELECT GROUP:Select: begins with select group.When: identifies SAS statements that are executed when a particular condition is true.&lt;br /&gt;Otherwise (optional): specifies a statement to be executed if no WHEN condition is met.End: ends a SELECT group.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;·What statement you code to tell SAS that it is to write to an external file? &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;What statement do you code to write the record to the file?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;PUT and FILE statements.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· If you're not wanting any SAS output from a data step, how would you code the data statement to prevent SAS from producing a set?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Data _Null_&lt;br /&gt;&lt;br /&gt;·&lt;strong&gt; What is the one statement to set the criteria of data that can be coded in any step?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Options statement: This a part of SAS program and effects all steps that follow it.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· Have you ever linked SAS code? If so, describe the link and any required statements used to either process the code or the step itself.· How would you include common or reuse code to be processed along with your statements?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;By using SAS Macros.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· When looking for data contained in a character string of 150 bytes, which function is the best to locate that data: scan, index, or indexc?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SCAN.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· If you have a data set that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variable?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Using KEEP option or statement.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· Code a PROC SORT on a data set containing State, District and County as the primary variables, along with several numeric variables.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Proc sort data=BY State District County ;&lt;br /&gt;Run ;&lt;br /&gt;&lt;br /&gt;· &lt;strong&gt;How would you delete duplicate observations?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;NONUPLICATES&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· How would you delete observations with duplicate keys?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;NODUPKEY·&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How would you code a merge that will keep only the observations that have matches from both sets.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Check the condition by using If statement in the Merge statement while merging datasets.&lt;br /&gt;&lt;br /&gt;·&lt;strong&gt; How would you code a merge that will write the matches of both to one data set, the non-matches from the left-most data&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;Step1: Define 3 datasets in DATA step&lt;br /&gt;Step2: Assign values of IN statement to different variables for 2 datasets&lt;br /&gt;Step3: Check for the condition using IF statement and output the matching to first dataset and no matches to different datasetsEx: data xxxmerge yyy(in = inxxx) zzz (in = inzzz);by aaa;if inxxx = 1 and inyyy = 1;run;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· What is the Program Data Vector (PDV)? What are its functions?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Function: To store the current obs;&lt;br /&gt;PDV (Program Data Vector) is a logical area in memory where SAS creates a dataset one observation at a time. When SAS processes a data step it has two phases. Compilation phase and execution phase. During the compilation phase the input buffer is created to hold a record from external file. After input buffer is created the PDV is created. The PDV is the area of memory where SAS builds dataset, one observation at a time. The PDV contains two automatic variables _N_ and _ERROR_.&lt;br /&gt;&lt;br /&gt;·&lt;strong&gt; Does SAS 'Translate' (compile) or does it 'Interpret'? Explain.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SAS compiles the code· At compile time when a SAS data set is read, what items are created?Automatic variables are created. Input Buffer, PDV and Descriptor Information·&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Name statements that are recognized at compile time only?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;PUT·&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Name statements that are execution only.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;INFILE, INPUT·&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Identify statements whose placement in the DATA step is critical.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;DATA, INPUT, RUN.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· Name statements that function at both compile and execution time.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;INPUT·&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;In the flow of DATA step processing, what is the first action in a typical DATA Step?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The DATA step begins with a DATA statement. Each time the DATA statement executes, a new iteration of the DATA step begins, and the _N_ automatic variable is incremented by 1.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· What is _n_?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;It is a Data counter variable in SAS.&lt;br /&gt;Note: Both -N- and _ERROR_ variables are always available to you in the data step.&lt;br /&gt;&lt;br /&gt;–N- indicates the number of times SAS has looped through the data step.&lt;br /&gt;This is not necessarily equal to the observation number, since a simple sub setting IF statement can change the relationship between Observation number and the number of iterations of the data step.&lt;br /&gt;&lt;br /&gt;The –ERROR- variable ha a value of 1 if there is a error in the data for that observation and 0 if it is not. Ex: This is nothing but a implicit variable created by SAS during data processing. It gives the total number of records SAS has iterated in a dataset. It is Available only for data step and not for PROCS.&lt;br /&gt;&lt;br /&gt;Eg. If we want to find every third record in a Dataset thenwe can use the _n_ as follows&lt;br /&gt;Data new-sas-data-set;&lt;br /&gt;Set old;&lt;br /&gt;if mod(_n_,3)= 1 then;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;Note: If we use a where clause to subset the _n_ will not yield the required result.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-5352973551153864668?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/5352973551153864668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=5352973551153864668' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/5352973551153864668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/5352973551153864668'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2008/01/sas-interview-questionsbase-sas.html' title='SAS Interview Questions:Base SAS'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-4684315402181528182</id><published>2008-01-26T01:27:00.000-08:00</published><updated>2008-01-26T03:05:43.339-08:00</updated><title type='text'>SAS interview questions:General</title><content type='html'>&lt;strong&gt;Under what circumstances would you &lt;/strong&gt;&lt;a id="AdBriteInlineAd_code" style="BACKGROUND: url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x 50% bottom; MARGIN-BOTTOM: -2px; PADDING-BOTTOM: 2px; CURSOR: pointer; COLOR: #006600; TEXT-DECORATION: none" onclick="" href="http://click.adbrite.com/mb/click.php?sid=510442&amp;amp;banner_id=10994272&amp;amp;variation_id=168543&amp;amp;uts=1201339755&amp;amp;cpc=302e3035&amp;amp;keyword_id=18275&amp;amp;inline=y&amp;amp;zk_id=29009462&amp;amp;ab=168362158&amp;amp;sscup=595a3a7225ef5514365f556bfa4769d4&amp;amp;sscra=98e97e77289ad236c69234f8d2da33dd&amp;amp;ub=2057932719&amp;amp;rs=&amp;amp;r=" target="_top" display="inline" keyword="code"&gt;&lt;strong&gt;code&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; a &lt;/strong&gt;&lt;a id="AdBriteInlineAd_select" style="BACKGROUND: url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x 50% bottom; MARGIN-BOTTOM: -2px; PADDING-BOTTOM: 2px; CURSOR: pointer; COLOR: #006600; TEXT-DECORATION: none" target="_top" display="inline" keyword="select"&gt;&lt;strong&gt;SELECT&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; construct instead of IF statements?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A: I think Select statement are &lt;a id="AdBriteInlineAd_used" style="BACKGROUND: url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x 50% bottom; MARGIN-BOTTOM: -2px; PADDING-BOTTOM: 2px; CURSOR: pointer; COLOR: #006600; TEXT-DECORATION: none" target="_top" display="inline" keyword="used"&gt;used&lt;/a&gt; when you are using one &lt;a id="AdBriteInlineAd_condition" style="BACKGROUND: url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x 50% bottom; MARGIN-BOTTOM: -2px; PADDING-BOTTOM: 2px; CURSOR: pointer; COLOR: #006600; TEXT-DECORATION: none" onclick="" href="http://click.adbrite.com/mb/click.php?sid=510442&amp;amp;banner_id=11363231&amp;amp;variation_id=467180&amp;amp;uts=1201339836&amp;amp;cpc=302e3035&amp;amp;keyword_id=2948084&amp;amp;inline=y&amp;amp;zk_id=29009462&amp;amp;ab=168362103&amp;amp;sscup=2d2343b76dfdc3452a2fa6874fd18c57&amp;amp;sscra=98e97e77289ad236c69234f8d2da33dd&amp;amp;ub=2057932719&amp;amp;rs=&amp;amp;r=" target="_top" display="inline" keyword="condition"&gt;condition&lt;/a&gt; to compare with several conditions likeselect passwhen Physics &gt;60when math &gt; 100when English = 50;otherwise fail;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the one statement to &lt;/strong&gt;&lt;a id="AdBriteInlineAd_set" style="BACKGROUND: url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x 50% bottom; MARGIN-BOTTOM: -2px; PADDING-BOTTOM: 2px; CURSOR: pointer; COLOR: #006600; TEXT-DECORATION: none" target="_top" display="inline" keyword="set"&gt;&lt;strong&gt;set&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; the criteria of data that can be codedin any step?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A) Options statement.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the &lt;/strong&gt;&lt;a id="AdBriteInlineAd_effect" style="BACKGROUND: url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x 50% bottom; MARGIN-BOTTOM: -2px; PADDING-BOTTOM: 2px; CURSOR: pointer; COLOR: #006600; TEXT-DECORATION: none" target="_top" display="inline" keyword="effect"&gt;&lt;strong&gt;effect&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; of the OPTIONS statement ERRORS=1?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A) The –ERROR- variable ha a value of 1 if there is a error in the data for that observation and 0 if it is not.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What's the difference between VAR A1 - A4 and VAR A1 -- A4 ?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A: There is no diff between VAR A1-A4 an VAR A1—A4. Where as If u submit VAR A1---A4 instead of VAR A1-A4 or VAR A1—A3, u will see error message in the log.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What do the SAS log messages "numeric values have been converted to character" mean? What are the implications?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;It implies that automatic conversion took place to make character functions possible&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Why is a STOP statement needed for the POINT= option on a SET statement?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Because POINT= reads only the specified observations, SAS cannot detect an end-of-file condition as it would if the file were being read sequentially.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How do you control the number of observations and/or variables read or written?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;FIRSTOBS and OBS optionApproximately&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;what date is represented by the SAS date value of 730?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;31st December 1961&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Identify statements whose placement in the DATA step is critical.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A: INPUT, DATA and RUN…&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Does SAS 'Translate' (compile) or does it 'Interpret'? Explain.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A) Compile&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What does the RUN statement do?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;a) When SAS editor looks at Run it starts compiling the data or proc step, if you have more than one data step or proc step or if you have a proc step Following the data step then you can avoid the usage of the run statement.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Why is SAS considered self-documenting?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A) SAS is considered self documenting because during the compilation time it creates and stores all the information about the data set like the time and date of the data set creation later No. of the variables later labels all that kind of info inside the dataset and you can look at that infousing proc contents procedure.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are some good SAS programming practices for processing very large data sets?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A) Sort them once, can use firstobs = and obs = ,&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the different between functions and PROCs that calculate the same simple descriptive statistics?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A)Functions can used inside the data step and on the same data set but with proc's you can create a new data sets to output the results. May be more ...........&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;If you were told to create many records from one record, show how youwould do this using arrays and with PROC TRANSPOSE?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A) I would use TRANSPOSE if the variables are less use arrays if the var are more ................. depends&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is a method for assigning first.VAR and last.VAR to the BY groupvariable on unsorted data?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A) In Unsorted data you can't use First. or Last.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How do you debug and test your SAS programs?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A) First thing is look into Log for errors or warning or NOTE in some cases or use the debugger in SAS data step.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What other SAS features do you use for error trapping and datavalidation?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A) Check the Log and for data validation things like Proc Freq, Proc means or some times proc print to look how the data looks like ........&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How would you combine 3 or more tables with different structures?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A) I think sort them with common variables and use merge statement. I am not sure what you mean different structures.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What areas of SAS are you most interested in?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;BASE, STAT, GRAPH, ETSBriefly describe 5 ways to do a "table lookup" in SAS.Match Merging, Direct Access, Format Tables, Arrays, PROC SQL&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What versions of SAS have you used (on which platforms)?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SAS 8.2 in Windows and UNIX, SAS 7 and 6.12&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are some good SAS programming practices for processing very large data sets?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Sampling method using OBS option or subsetting, commenting the Lines, Use Data Null&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are some problems you might encounter in processing missing values? &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;In Data steps? Arithmetic? Comparisons? Functions? Classifying data?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The result of any operation with missing value will result in missing value. Most SAS statistical procedures exclude observations with any missing variable values from an analysis.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Using PROC TRANSPOSE&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the different between functions and PROCs that calculate the same simple descriptive statistics?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Proc can be used with wider scope and the results can be sent to a different dataset. Functions usually affect the existing datasets.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;If you were told to create many records from one record,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;show how you would do this using array and with PROC TRANSPOSE?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Declare array for number of variables in the record and then used Do loopProc Transpose with VAR statement.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are _numeric_ and _character_ and what do they do?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Will either read or writes all numeric and character variables in dataset.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How would you create multiple observations from a single observation?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Using double Trailing @@&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;For what purpose would you use the RETAIN statement?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The retain statement is used to hold the values of variables across iterations of the data step. Normally, all variables in the data step are set to missing at the start of each iteration of the data step.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the order of evaluation of the comparison operators: &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;+ - * / ** ()?(), **, *, /, +, -&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How could you generate test data with no input data?Using Data Null and put statementHow do you debug and test your SAS programs?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Using Obs=0 and systems options to trace the program execution in log.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What can you learn from the SAS log when debugging?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;It will display the execution of whole program and the logic. It will also display the error with line number so that you can and edit the program.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the purpose of _error_?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;It has only to values, which are 1 for error and 0 for no error&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How can you put a "trace" in your program?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;By using ODS TRACE ON&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How does SAS handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, PROCs?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Missing values will be assigned as missing in Assignment statement. Sort order treats missing as second smallest followed by underscore.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How do you test for missing values?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Using Subset functions like IF then Else,&lt;br /&gt;&lt;br /&gt; &lt;strong&gt;Where and SelectHow are numeric and character missing values represented internally?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Character as Blank or “ and Numeric as.&lt;a href="http://4.bp.blogspot.com/_yE2Kw6HT3CA/R2BlxaiUXSI/AAAAAAAAADo/J4kLmAsaACM/s1600-h/Interview.jpg"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Which date functions advances a date time or date/time value by a given interval?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;INTNX.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;In the flow of DATA step processing, &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;what is the first action in a typical DATA Step?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;When you submit a DATA step, SAS processes the DATA step and then creates a new SAS data set.( creation of input buffer and PDV)Compilation PhaseExecution Phase&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are SAS/ACCESS and SAS/CONNECT?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SAS/Access only process through the databases like Oracle, SQL-server, Ms-Access etc. SAS/Connect only use Server connection.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the one statement to set the criteria of data that can be coded in any step? &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;OPTIONS Statement, Label statement, Keep / Drop statements.What is the purpose of using the N=PS option?The N=PS option creates a buffer in memory which is large enough to store PAGESIZE (PS) lines and enables a page to be formatted randomly prior to it being printed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are the scrubbing procedures in SAS?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Proc Sort with nodupkey option, because it will eliminate the duplicate values.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are the new features included in the new version of SAS i.e., SAS9.1.3? &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The main advantage of version 9 is faster execution of applications and centralized access of data and support.There are lots of changes has been made in the version 9 when we compared with the version 8.&lt;br /&gt;The following are the few:SAS version 9 supports Formats longer than 8 bytes &amp;amp; is not possible with version 8.&lt;br /&gt;Length for Numeric format allowed in version 9 is 32 where as 8 in version 8.&lt;br /&gt;Length for Character names in version 9 is 31 where as in version 8 is 32.&lt;br /&gt;Length for numeric informat in version 9 is 31, 8 in version 8.Length for character names is 30, 32 in version 8.3 new informats are available in version 9 to convert various date, time and datetime forms of data into a SAS date or SAS time.&lt;br /&gt;&lt;br /&gt;·ANYDTDTEW. - Converts to a SAS date value ·ANYDTTMEW. - Converts to a SAS time value. ·ANYDTDTMW. -Converts to a SAS datetime value.CALL SYMPUTX Macro statement is added in the version 9 which creates a macro variable at execution time in the data step by ·Trimming trailing blanks · Automatically converting numeric value to character.&lt;br /&gt;&lt;br /&gt;New ODS option (COLUMN OPTION) is included to create a multiple columns in the output.WHAT DIFFERRENCE DID YOU FIND AMONG VERSION 6 8 AND 9 OF SAS.&lt;br /&gt;&lt;br /&gt; The SAS 9 Architecture is fundamentally different from any prior version of SAS. In the SAS 9 architecture, SAS relies on a new component,&lt;br /&gt;the Metadata Server, to provide an information layer between the programs and the data they access.&lt;br /&gt;Metadata, such as security permissions for SAS libraries and where the various SAS servers are running, are maintained in a common repository.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What has been your most common programming mistake? &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Missing semicolon and not checking log after submitting program,&lt;br /&gt;Not using debugging techniques and not using Fsview option vigorously.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Name several ways to achieve efficiency in your program. Explain trade-offs.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; &lt;/strong&gt;&lt;br /&gt;Efficiency and performance strategies can be classified into 5 different areas.&lt;br /&gt;·CPU time&lt;br /&gt; ·Data Storage&lt;br /&gt;· Elapsed time&lt;br /&gt;· Input/Output&lt;br /&gt; · Memory&lt;br /&gt;&lt;br /&gt;CPU Time and Elapsed Time- Base line measurements Few Examples for efficiency violations: Retaining unwanted datasets Not sub setting early to eliminate unwanted records.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Efficiency improving techniques:&lt;/strong&gt; Using KEEP and DROP statements to retain necessary variables. Use macros for reducing the code. Using IF-THEN/ELSE statements to process data programming. Use SQL procedure to reduce number of programming steps. Using of length statements to reduce the variable size for reducing the Data storage.Use of Data _NULL_ steps for processing null data sets for Data storage.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What other SAS products have you used and consider yourself proficient in using? &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Data _NULL_ statement, Proc Means, Proc Report, Proc tabulate, Proc freq and Proc print, Proc Univariate etc.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the significance of the 'OF' in X=SUM (OF a1-a4, a6, a9);&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;If don’t use the OF function it might not be interpreted as we expect. For example the function above calculates the sum of a1 minus a4 plus a6 and a9 and not the whole sum of a1 to a4 &amp;amp; a6 and a9. It is true for mean option also.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What do the PUT and INPUT functions do?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt; INPUT function converts character data values to numeric values. PUT function converts numeric values to character values.&lt;br /&gt;EX: for INPUT: INPUT (source, informat)For PUT: PUT (source, format)Note that INPUT function requires INFORMAT and PUT function requires FORMAT.&lt;br /&gt;If we omit the INPUT or the PUT function during the data conversion, SAS will detect the mismatched variables and will try an automatic character-to-numeric or numeric-to-character conversion.&lt;br /&gt;But sometimes this doesn’t work because $ sign prevents such conversion. Therefore it is always advisable to include INPUT and PUT functions in your programs when conversions occur.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Which date function advances a date, time or datetime value by a given interval? &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;INTNX: INTNX function advances a date, time, or datetime value by a given interval, and returns a date, time, or datetime value.&lt;br /&gt;&lt;br /&gt;Ex: INTNX(interval,start-from,number-of-increments,alignment)&lt;br /&gt;INTCK: INTCK(interval,start-of-period,end-of-period) is an interval functioncounts the number of intervals between two give SAS dates, Time and/or datetime. DATETIME () returns the current date and time of day. DATDIF (sdate,edate,basis): returns the number of days between two dates.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What do the MOD and INT function do? What do the PAD and DIM functions do? &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;MOD: Modulo is a constant or numeric variable, the function returns the reminder after numeric value divided by modulo.&lt;br /&gt;INT: It returns the integer portion of a numeric value truncating the decimal portion.&lt;br /&gt;PAD: it pads each record with blanks so that all data lines have the same length. It is used in the INFILE statement. It is useful only when missing data occurs at the end of the record.&lt;br /&gt;CATX: concatenate character strings, removes leading and trailing blanks and inserts separators.&lt;br /&gt;SCAN: it returns a specified word from a character value. Scan function assigns a length of 200 to each target variable.&lt;br /&gt;SUBSTR: extracts a sub string and replaces character values.Extraction of a substring: Middleinitial=substr(middlename,1,1); Replacing character values: substr (phone,1,3)=’433’; If SUBSTR function is on the left side of a statement, the function replaces the contents of the character variable.TRIM: trims the trailing blanks from the character values.&lt;br /&gt;SCAN vs. SUBSTR: SCAN extracts words within a value that is marked by delimiters. SUBSTR extracts a portion of the value by stating the specific location.&lt;br /&gt;&lt;br /&gt; It is best used when we know the exact position of the sub string to extract from a character value.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;The first argument to the MOD function is a numeric, the second is a non-zero numeric; the result is the remainder when the integer quotient of argument-1 is divided by argument-2. The INT function takes only one argument and returns the integer portion of an argument, truncating the decimal portion.&lt;br /&gt;Note that the argument can be an expression.&lt;br /&gt;DATA NEW ;&lt;br /&gt;A = 123456 ;&lt;br /&gt;X = INT( A/1000 ) ;&lt;br /&gt;Y = MOD( A, 1000 ) ;&lt;br /&gt;Z = MOD( INT( A/100 ), 100 ) ;&lt;br /&gt;PUT A= X= Y= Z= ;&lt;br /&gt;RUN ;&lt;br /&gt;A=123456&lt;br /&gt;X=123&lt;br /&gt;Y=456&lt;br /&gt;Z=34&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;In ARRAY processing, what does the DIM function do?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;DIM: It is used to return the number of elements in the array. When we use Dim function we would have to re –specify the stop value of an iterative DO statement if u change the dimension of the array.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How would you determine the number of missing or nonmissing values in computations?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;To determine the number of missing values that are excluded in a computation, use the NMISS function.&lt;br /&gt;data _null_;&lt;br /&gt;m = . ;&lt;br /&gt;y = 4 ;&lt;br /&gt; z = 0 ;&lt;br /&gt;N = N(m , y, z);&lt;br /&gt;NMISS = NMISS (m , y, z);&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;The above program results in N = 2 (Number of non missing values) and NMISS = 1 (number of missing values).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Do you need to know if there are any missing values?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt; Just use: missing_values=MISSING(field1,field2,field3); This function simply returns 0 if there aren't any or 1 if there are missing values.&lt;br /&gt;If you need to know how many missing values you have then use num_missing=NMISS(field1,field2,field3);&lt;br /&gt; You can also find the number of non-missing values with non_missing=N (field1,field2,field3);&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the difference between: x=a+b+c+d; and x=SUM (of a, b, c ,d);?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Is anyone wondering why you wouldn’t just use total=field1+field2+field3;&lt;br /&gt;First, how do you want missing values handled? The SUM function returns the sum of non-missing values. If you choose addition, you will get a missing value for the result if any of the fields are missing. Which one is appropriate depends upon your needs.&lt;br /&gt;&lt;br /&gt;However, there is an advantage to use the SUM function even if you want the results to be missing. If you have more than a couple fields, you can often use shortcuts in writing the field names If your fields are not numbered sequentially but are stored in the program data vector together then you can use: total=SUM(of fielda--zfield); Just make sure you remember the “of” and the double dashes or your code will run but you won’t get your intended results. Mean is another function where the function will calculate differently than the writing out the formula if you have missing values.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;There is a field containing a date. It needs to be displayed in the format "ddmonyy" if it's before 1975, "dd mon ccyy" if it's after 1985, and as 'Disco Years' if it's between 1975 and 1985. How would you accomplish this in data step code? Using only PROC FORMAT.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;data new ;&lt;br /&gt;input date ddmmyy10.;&lt;br /&gt;cards;&lt;br /&gt;01/05/1955&lt;br /&gt;01/09/1970&lt;br /&gt;01/12/1975&lt;br /&gt;19/10/1979&lt;br /&gt;25/10/1982&lt;br /&gt;10/10/1988&lt;br /&gt;27/12/1991&lt;br /&gt;;&lt;br /&gt;run;&lt;br /&gt;proc format ;&lt;br /&gt;value dat low-'01jan1975'd=ddmmyy10.&lt;br /&gt;'01jan1975'd-'01JAN1985'd="Disco Years"&lt;br /&gt;'01JAN1985'd-high=date9.;&lt;br /&gt;run;&lt;br /&gt;proc print;&lt;br /&gt;format date dat. ;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;In the following DATA step, what is needed for 'fraction' to print to the log?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;data _null_;&lt;br /&gt;x=1/3;&lt;br /&gt;if x=.3333 then put 'fraction';&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the difference between calculating the 'mean' using the mean function and PROC MEANS?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;By default Proc Means calculate the summary statistics like N, Mean, Std deviation, Minimum and maximum, Where as Mean function compute only the mean values.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are some differences between PROC SUMMARY and PROC MEANS?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Proc means by default give you the output in the output window and you can stop this by the option NOPRINT and can take the output in the separate file by the statement OUTPUTOUT= , But, proc summary doesn't give the default output, we have to explicitly give the output statement and then print the data by giving PRINT option to see the result.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is a problem with merging two data sets that have variables with the same name but different data?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Understanding the basic algorithm of MERGE will help you understand how the stepProcesses. There are still a few common scenarios whose results sometimes catch users off guard.&lt;br /&gt;Here are a few of the most frequent 'gotchas':&lt;br /&gt;1- BY variables has different lengthsIt is possible to perform a MERGE when the lengths of the BY variables are different,&lt;br /&gt;But if the data set with the shorter version is listed first on the MERGE statement,&lt;br /&gt;&lt;br /&gt;theShorter length will be used for the length of the BY variable during the merge. Due to this shorter length, truncation occurs and unintended combinations could result.&lt;br /&gt;&lt;br /&gt;In Version 8, a warning is issued to point out this data integrity risk. The warning will be issued regardless of which data set is listed first:&lt;br /&gt;&lt;br /&gt;WARNING: Multiple lengths were specified for the BY variable name by input data sets.This may cause unexpected results. Truncation can be avoided by naming the data set with the longest length for the BY variable first on the MERGE statement, but the warning message is still issued. To prevent the warning, ensure the BY variables have the same length prior to combining them in the MERGE step with PROC CONTENTS.&lt;br /&gt;&lt;br /&gt; You can change the variable length with either a LENGTH statement in the merge DATA step prior to the MERGE statement, or by recreating the data sets to have identical lengths for the BY variables.&lt;br /&gt;Note: When doing MERGE we should not have MERGE and IF-THEN statement in one data step if the IF-THEN statement involves two variables that come from two different merging data sets.&lt;br /&gt;If it is not completely clear when MERGE and IF-THEN can be used in one data step and when it should not be, then it is best to simply always separate them in different data step. By following the above recommendation, it will ensure an error-free merge result.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Which data set is the controlling data set in the MERGE statement?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Dataset having the less number of observations control the data set in the merge statement.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How do the IN= variables improve the capability of a MERGE?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The IN=variables&lt;br /&gt;What if you want to keep in the output data set of a merge only the matches (only those observations to which both input data sets contribute)? SAS will set up for you special temporary variables,&lt;br /&gt;called the "IN=" variables, so that you can do this and more. Here's what you have to do: signal to SAS on the MERGE statement that you need the IN= variables for the input data set(s) use the IN= variables in the data step appropriately, So to keep only the matches in the match-merge above, ask for the IN= variables and use them:&lt;br /&gt;data three;&lt;br /&gt;merge one(in=x) two(in=y);&lt;br /&gt;/* x &amp;amp; y are your choices of names */&lt;br /&gt;by id;&lt;br /&gt;/* for the IN= variables for data */&lt;br /&gt;if x=1 and y=1; /* sets one and two respectively */&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What techniques and/or PROCs do you use for tables?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Proc Freq, Proc univariate, Proc Tabulate &amp;amp; Proc Report.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Do you prefer PROC REPORT or PROC TABULATE? Why?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I prefer to use Proc report until I have to create cross tabulation tables, because, It gives me so many options to modify the look up of my table, (ex: Width option, by this we can change the width of each column in the table) Where as Proc tabulate unable to produce some of the things in my table. Ex: tabulate doesn’t produce n (%) in the desirable format.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How experienced are you with customized reporting and use of DATA _NULL_ features?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I have very good experience in creating customized reports as well as with Data _NULL_ step. It’s a Data step that generates a report without creating the dataset there by development time can be saved. The other advantages of Data NULL is when we submit, if there is any compilation error is there in the statement which can be detected and written to the log there by error can be detected by checking the log after submitting it. It is also used to create the macro variables in the data set.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the difference between nodup and nodupkey options? &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;NODUP compares all the variables in our dataset while NODUPKEY compares just the BY variables.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the difference between compiler and interpreter? Give any one example (software product) that act as an interpreter?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Both are similar as they achieve similar purposes, but inherently different as to how they achieve that purpose. The interpreter translates instructions one at a time, and then executes those instructions immediately. Compiled code takes programs (source) written in SAS programming language, and then ultimately translates it into object code or machine language. Compiled code does the work much more efficiently, because it produces a complete machine language program, which can then be executed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Code the table’s statement for a single level frequency?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Proc freq data=lib.dataset;&lt;br /&gt;table var;&lt;br /&gt;*here you can mention single variable of multiple variables seperated by space to get single frequency;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the main difference between rename and label?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1. Label is global and rename is local i.e., label statement can be used either in proc or data step where as rename should be used only in data step.&lt;br /&gt; 2.If we rename a variable, old name will be lost but if we label a variable its short name (old name) exists along with its descriptive name.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is Enterprise Guide? What is the use of it?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;It is an approach to import text files with SAS (It comes free with Base SAS version 9.0)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What other SAS features do you use for error trapping and data validation? What are the validation tools in SAS?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;For dataset: Data set name/debug&lt;br /&gt;Data set: name/stmtchk&lt;br /&gt;For macros: Options:mprint mlogic symbolgen.How can you put a "trace" in your program?ODS Trace ON, ODS Trace OFF the trace records.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How would you code a merge that will keep only the observations that have matches from both data sets?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Using "IN" variable option. Look at the following example.&lt;br /&gt;data three;&lt;br /&gt;merge one(in=x) two(in=y);&lt;br /&gt;by id;&lt;br /&gt;if x=1 and y=1;&lt;br /&gt;run;&lt;br /&gt;or&lt;br /&gt;data three;&lt;br /&gt;merge one(in=x) two(in=y);&lt;br /&gt;by id;&lt;br /&gt;if x and y;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are input dataset and output dataset options?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Input data set options are obs, firstobs, where, in output data set options compress, reuse.Both input and output dataset options include keep, drop, rename, obs, first obs.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How can u create zero observation dataset?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Creating a data set by using the like clause.&lt;br /&gt;ex:&lt;br /&gt;proc sql;&lt;br /&gt;create table latha.emp like oracle.emp;&lt;br /&gt;quit;&lt;br /&gt;&lt;br /&gt;In this the like clause triggers the existing table structure to be copied to the new table. using this method result in the creation of an empty table.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Have you ever-linked SAS code, If so, describe the link and any required statements used to either process the code or the step itself?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In the editor window we write&lt;br /&gt;%include 'path of the sas file';&lt;br /&gt;run;&lt;br /&gt;if it is with non-windowing environment no need to give run statement.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How can u import .CSV file in to SAS? tell Syntax?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;To create CSV file, we have to open notepad, then, declare the variables.&lt;br /&gt;proc import datafile='E:\age.csv'out=sarathdbms=csv replace;getnames=yes;&lt;br /&gt;proc print data=sarath;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the use of Proc SQl?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;PROC SQL is a powerful tool in SAS, which combines the functionality of data and proc steps. PROC SQL can sort, summarize, subset, join (merge), and concatenate datasets, create new variables, and print the results or create a new dataset all in one step! PROC SQL uses fewer resources when compard to that of data and proc steps. To join files in PROC SQL it does not require to sort the data prior to merging, which is must, is data merge.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is SAS GRAPH?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SAS/GRAPH software creates and delivers accurate, high-impact visuals that enable decision makers to gain a quick understanding of critical business issues.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Why is a STOP statement needed for the point=option on a SET statement?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;When you use the POINT= option, you must include a STOP statement to stop DATA step processing, programming logic that checks for an invalid value of the POINT= variable, or Both. Because POINT= reads only those observations that are specified in the DO statement, SAS cannot read an end-of-file indicator as it would if the file were being read sequentially. Because reading an end-of-file indicator ends a DATA step automatically, failure to substitute another means of ending the DATA step when you use POINT= can cause the DATA step to go into a continuous loop.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the difference between nodup and nodupkey options?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The NODUP option checks for and eliminates duplicate observations. The NODUPKEY option checks for and eliminates duplicate observations by variable values.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-4684315402181528182?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/4684315402181528182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=4684315402181528182' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/4684315402181528182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/4684315402181528182'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2008/01/sas-interview-questionsgeneral.html' title='SAS interview questions:General'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-5737362651390532252</id><published>2008-01-26T00:28:00.000-08:00</published><updated>2008-01-26T01:27:23.107-08:00</updated><title type='text'>SAS interview Q &amp; A: PROC SQl and SAS GRAPH and ODS</title><content type='html'>PROC SQL:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. What are the three types of join?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. The three types of join are inner join, left join and right join.The inner join &lt;a id="AdBriteInlineAd_option" style="BACKGROUND: url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x 50% bottom; MARGIN-BOTTOM: -2px; PADDING-BOTTOM: 2px; CURSOR: pointer; COLOR: #006600; TEXT-DECORATION: none" onclick="" href="http://click.adbrite.com/mb/click.php?sid=510442&amp;amp;banner_id=10852338&amp;amp;variation_id=119516&amp;amp;uts=1201336257&amp;amp;cpc=312e3039&amp;amp;keyword_id=283560&amp;amp;inline=y&amp;amp;zk_id=29009462&amp;amp;ab=168362115&amp;amp;sscup=5aef0a8ecd228bb6b502318bfad10016&amp;amp;sscra=98e97e77289ad236c69234f8d2da33dd&amp;amp;ub=2057932719&amp;amp;rs=&amp;amp;r=" target="_top" display="inline" keyword="option"&gt;option&lt;/a&gt; takes the &lt;a id="AdBriteInlineAd_matching" style="BACKGROUND: url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x 50% bottom; MARGIN-BOTTOM: -2px; PADDING-BOTTOM: 2px; CURSOR: pointer; COLOR: #006600; TEXT-DECORATION: none" target="_top" display="inline" keyword="matching"&gt;matching&lt;/a&gt; values from both the tables by the ON option. The left join selects all the variables from the first table and joins second table to it. The right join selects all the variables of table b first and join the table a to it.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Have you ever used PROC SQL for data summarization?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. Yes I have used it for summarization at times…For e.g if I have to calculate the max value of BP for patients 101 102 and 103 then I use the max (bpd) function to get the maximum value and use group by statement to group the patients accordingly.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Tell me about your SQL experience?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. I have used the SAS/ACCESS SQL pass thru facility for connection with external databases and importing tables from them and also Microsoft access and excel files.Besides this, lot of times I have used PROC SQL for joining tables.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Once you have had the data read into SAS datasets are you more of a data step programmer or a PROC SQL programmer?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. It depends on what types of analysis datasets are required for creating tables but I am more of a data step programmer as it gives me more flexibility.For e.g creating a change from baseline data set for blood pressure sometimes I have to retain certain values …use arrays ….or use the first. -and last. variables.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. What types of programming tasks do you use PROC SQL for versus the data step?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;A. Proc SQL is very convenient for performing table joins compared to a data step merge as it does not require the key columns to be sorted prior to join. A data step is more suitable for sequential observation-by-observation processing.PROC SQL can save a great deal of &lt;a id="AdBriteInlineAd_time" style="BACKGROUND: url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x 50% bottom; MARGIN-BOTTOM: -2px; PADDING-BOTTOM: 2px; CURSOR: pointer; COLOR: #006600; TEXT-DECORATION: none" target="_top" display="inline" keyword="time"&gt;time&lt;/a&gt; if u want to filter the variables while selecting or u can modify them …apply format….creating new variables , macrovariables…as well as subsetting the data.PROC SQL offers great flexibility for joining tables.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6. Have u ever used PROC SQL to read in a raw data &lt;/strong&gt;&lt;a id="AdBriteInlineAd_file" style="BACKGROUND: url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x 50% bottom; MARGIN-BOTTOM: -2px; PADDING-BOTTOM: 2px; CURSOR: pointer; COLOR: #006600; TEXT-DECORATION: none" target="_top" display="inline" keyword="file"&gt;&lt;strong&gt;file&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. No. I don’t think it can be used.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7. How do you merge data in Proc SQL?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The three types of join are inner join, left join and right join. The inner join option takes the matching values from both the tables by the ON option. The left join selects all the variables from the first table and joins second table to it. The right join selects all the variables of table b first and join the table a to it.&lt;br /&gt;PROC SQL;&lt;br /&gt;CREATE TABLE BOTH AS&lt;br /&gt;SELECT A.PATIENT,&lt;br /&gt;A.DATE FORMAT=DATE7. AS DATE,&lt;br /&gt;A.PULSE,B.MED, B.DOSES,&lt;br /&gt;B.AMT FORMAT=4.1&lt;br /&gt;FROM VITALS A INNER JOIN DOSING B&lt;br /&gt;ON (A.PATIENT = B.PATIENT)&lt;br /&gt;AND(A.DATE = B.DATE)&lt;br /&gt;ORDER BY PATIENT, DATE;&lt;br /&gt;QUIT;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;8. What are the statements in Proc SQl?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Select, From, Where, Group By, Having, Order.&lt;br /&gt;PROC SQL;&lt;br /&gt;CREATE TABLE HIGHBPP2 AS&lt;br /&gt;SELECT PATIENT,&lt;br /&gt;COUNT (PATIENT) AS N,&lt;br /&gt;DATE FORMAT=DATE7.,&lt;br /&gt;MAX(BPD) AS BPDHIGH&lt;br /&gt;FROM VITALS&lt;br /&gt;WHERE PATIENT IN (101 102 103)&lt;br /&gt;GROUP BY PATIENT&lt;br /&gt;HAVING BPD = CALCULATED BPDHIGH&lt;br /&gt;ORDER BY CALCULATED BPDHIGH;&lt;br /&gt;Quit;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;9. Why and when do you use Proc SQl?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Proc SQL is very convenient for performing table joins compared to a data step merge as it does not require the key columns to be sorted prior to join. A data step is more suitable for sequential observation-by-observation processing.&lt;br /&gt;PROC SQL can save a great deal of time if u want to filter the variables while selecting or we can modify them, apply format and creating new variables, macrovariables…as well as subsetting the data. PROC SQL offers great flexibility for joining tables.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SAS GRAPH:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;1. What type of graphs have you have generated using SAS?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. I have used Proc GPLOT where I have created change from baseline scatter plots. I have also used Proc LIFETEST to create Kaplan-Meier survival estimates plots for survival analysis to determine which treatment displays better time-to-event distribution.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Have you ever used GREPLAY?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. YES, I have used the PROC GREPLAY point and click interface to integrate 4 graphs in one page. Which were produced by the reg procedure.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. What is the symbol statement used for?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. Symbol statement is used for placing symbols in the graphics output.Associated variables can specify the color, font and heights of the symbols displayed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Have you ever used the annotate facility? What is a situation when you have had to use the ANNOTATE facility in the past?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. Yes, I have used the annotate facility for graphs. I have used the annotate facility to position labels in the Kaplan-Meier survival estimates, where I had to specify the function as ‘label’ and give the x and y co-ordinates and the position where this label is to be placed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ODS (OUTPUT DELIVERY SYSTEM):&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;1. What are all the ODS procedure have u encountered?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Tracing and selecting the procedure Output;&lt;br /&gt;ODS Trace on;&lt;br /&gt;Proc steps…;&lt;br /&gt;Run;&lt;br /&gt;ODS Trace off;&lt;br /&gt;ODS Select statement,Proc steps…;&lt;br /&gt;ODS Select output-object-list;&lt;br /&gt;Run;&lt;br /&gt;ODS Output statement,ODS output output-object= new SAS dataset;&lt;br /&gt;ODS html body = “path\marinebody.html”Contents = “path\marineTOC.html”Page = “ path\marinepage.html”Frame= “path\marineframe.html”;…..&lt;br /&gt;ODS html close;&lt;br /&gt;ODS rtf file = “filename.rtf” &lt;a id="AdBriteInlineAd_options" style="BACKGROUND: url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x 50% bottom; MARGIN-BOTTOM: -2px; PADDING-BOTTOM: 2px; CURSOR: pointer; COLOR: #006600; TEXT-DECORATION: none" target="_top" display="inline" keyword="options"&gt;options&lt;/a&gt;;&lt;br /&gt;Options like columns=n, bodytitle, SASdate and style.ODS rtf close;&lt;br /&gt;SimilarlyODS Pdf file = “filename.pdf” options; ……..&lt;br /&gt;ODS pdf close;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. What is your experience with ODS?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. I have used ODS for creating files output formats RTF HTML and PDF as per the requirement of my manager. HTML files could be posted on the web site for viewing or can also be imported into word processors.ODS HTML body = ‘path’Contents= ‘path’Frame = ‘path’ODS HTML close;ODS RTF FILE = ‘path’ODS RTF close; When we create RTF output we can copy it into word document and edit and resize it like word tables.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. What does the trace option do?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. ODS Trace is used to find the names of the particular output objects when several of them are created by some procedure.&lt;br /&gt;ODS TRACE ON;&lt;br /&gt;ODS TRACE OFF;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SAS UNIX:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;PROC SQL:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;1. What are the three types of join?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. The three types of join are inner join, left join and right join.The inner join option takes the matching values from both the tables by the ON option. The left join selects all the variables from the first table and joins second table to it. The right join selects all the variables of table b first and join the table a to it.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Have you ever used PROC SQL for data summarization?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. Yes I have used it for summarization at times…For e.g if I have to calculate the max value of BP for patients 101 102 and 103 then I use the max (bpd) function to get the maximum value and use group by statement to group the patients accordingly.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Tell me about your SQL experience?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. I have used the SAS/ACCESS SQL pass thru facility for connection with external databases and importing tables from them and also Microsoft access and excel files.Besides this, lot of times I have used PROC SQL for joining tables.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Once you have had the data read into SAS datasets are you more of a data step programmer or a PROC SQL programmer?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. It depends on what types of analysis datasets are required for creating tables but I am more of a data step programmer as it gives me more flexibility.For e.g creating a change from baseline data set for blood pressure sometimes I have to retain certain values …use arrays ….or use the first. -and last. variables.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. What types of programming tasks do you use PROC SQL for versus the data step?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. Proc SQL is very convenient for performing table joins compared to a data step merge as it does not require the key columns to be sorted prior to join. A data step is more suitable for sequential observation-by-observation processing.PROC SQL can save a great deal of time if u want to filter the variables while selecting or u can modify them …apply format….creating new variables , macrovariables…as well as subsetting the data.PROC SQL offers great flexibility for joining tables.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6. Have u ever used PROC SQL to read in a raw data file?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. No. I don’t think it can be used.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7. How do you merge data in Proc SQL?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The three types of join are inner join, left join and right join. The inner join option takes the matching values from both the tables by the ON option. The left join selects all the variables from the first table and joins second table to it. The right join selects all the variables of table b first and join the table a to it.&lt;br /&gt;PROC SQL;&lt;br /&gt;CREATE TABLE BOTH AS&lt;br /&gt;SELECT A.PATIENT,A.DATE FORMAT=DATE7.&lt;br /&gt;AS DATE, A.PULSE,B.MED, B.DOSES, B.AMT FORMAT=4.1&lt;br /&gt;FROM&lt;br /&gt;VITALS A INNER JOIN DOSING BON (A.PATIENT = B.PATIENT)&lt;br /&gt;AND(A.DATE = B.DATE)&lt;br /&gt;ORDER BY PATIENT, DATE;&lt;br /&gt;QUIT;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;8. What are the statements in Proc SQl?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Select, From, Where, Group By, Having, Order.&lt;br /&gt;PROC SQL;&lt;br /&gt;CREATE TABLE HIGHBPP2 AS&lt;br /&gt;SELECT PATIENT, COUNT (PATIENT) AS N,&lt;br /&gt;DATE FORMAT=DATE7.,&lt;br /&gt;MAX(BPD) AS BPDHIGH&lt;br /&gt;FROM VITALS&lt;br /&gt;WHERE PATIENT IN (101 102 103)&lt;br /&gt;GROUP BY PATIENTHAVING BPD = CALCULATED BPDHIGH&lt;br /&gt;ORDER BY CALCULATED BPDHIGH;&lt;br /&gt;Quit;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;9. Why and when do you use Proc SQl?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Proc SQL is very convenient for performing table joins compared to a data step merge as it does not require the key columns to be sorted prior to join. A data step is more suitable for sequential observation-by-observation processing.PROC SQL can save a great deal of time if u want to filter the variables while selecting or we can modify them, apply format and creating new variables, macrovariables…as well as subsetting the data. PROC SQL offers great flexibility for joining tables.&lt;br /&gt;&lt;br /&gt;SAS GRAPH:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. What type of graphs have you have generated using SAS?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. I have used Proc GPLOT where I have created change from baseline scatter plots. I have also used Proc LIFETEST to create Kaplan-Meier survival estimates plots for survival analysis to determine which treatment displays better time-to-event distribution.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Have you ever used GREPLAY?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. YES, I have used the PROC GREPLAY point and click interface to integrate 4 graphs in one page. Which were produced by the reg procedure.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. What is the symbol statement used for?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. Symbol statement is used for placing symbols in the graphics output.Associated variables can specify the color, font and heights of the symbols displayed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Have you ever used the annotate facility? What is a situation when you have had to use the ANNOTATE facility in the past?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. Yes, I have used the annotate facility for graphs. I have used the annotate facility to position labels in the Kaplan-Meier survival estimates, where I had to specify the function as ‘label’ and give the x and y co-ordinates and the position where this label is to be placed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ODS (OUTPUT DELIVERY SYSTEM):&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. What are all the ODS procedure have u encountered?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Tracing and selecting the procedure Output;&lt;br /&gt;ODS Trace on;&lt;br /&gt;Proc steps…;&lt;br /&gt;Run;&lt;br /&gt;ODS Trace off;&lt;br /&gt;ODS Select statement,Proc steps…;&lt;br /&gt;ODS Select output-object-list;&lt;br /&gt;Run;&lt;br /&gt;ODS Output statement,ODS output output-object= new SAS dataset;&lt;br /&gt;ODS html body = “path\marinebody.html”Contents = “path\marineTOC.html”Page = “ path\marinepage.html”Frame= “path\marineframe.html”;…..&lt;br /&gt;ODS html close;&lt;br /&gt;ODS rtf file = “filename.rtf” options;&lt;br /&gt;Options like columns=n, bodytitle, SASdate and style.ODS rtf close;&lt;br /&gt;SimilarlyODS Pdf file = “filename.pdf” options; ……..&lt;br /&gt;ODS pdf close;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. What is your experience with ODS?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. I have used ODS for creating files output formats RTF HTML and PDF as per the requirement of my manager. HTML files could be posted on the web site for viewing or can also be imported into word processors.ODS HTML body = ‘path’Contents= ‘path’Frame = ‘path’ODS HTML close;ODS RTF FILE = ‘path’ODS RTF close; When we create RTF output we can copy it into word document and edit and resize it like word tables.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. What does the trace option do?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. ODS Trace is used to find the names of the particular output objects when several of them are created by some procedure.&lt;br /&gt;ODS TRACE ON;&lt;br /&gt;ODS TRACE OFF;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SAS UNIX:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Unix environment?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SAS can effectively be used with Unix operating system. We have some options that would let the programmer to extract files from the terminal as well as save the Output to the terminal.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. When would you use UNIX instead of PC SAS?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;When we need to submit the &lt;a id="AdBriteInlineAd_program" style="BACKGROUND: url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x 50% bottom; MARGIN-BOTTOM: -2px; PADDING-BOTTOM: 2px; CURSOR: pointer; COLOR: #006600; TEXT-DECORATION: none" target="_top" display="inline" keyword="program"&gt;program&lt;/a&gt; in a batch/ non-interactive mode.When we are concerned with security issues.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. What operating systems can you sit down at today and be productive?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I can be productive on Unix and Windows system.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Are you comfortable at the command line?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. Yes, I am comfortable at the command line mode.I can write commands like for listing all files (-a), Listing directory itself (-d) and ls, ls-l privileges.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. Setting permissions?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. r Read permission&lt;br /&gt;w Write permission&lt;br /&gt;x Execute permission&lt;br /&gt;- no permission&lt;br /&gt;Change permissions on file&lt;br /&gt;Chmod [options] file&lt;br /&gt;Chmod u + w file [gives the user (owner) write permission]&lt;br /&gt;Chmod g + r file [gives the group read permission]&lt;br /&gt;Chmod o – x file [removes execute permission for others]&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6. Can you write shell scripts?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. Yes, I can write shell scripts&lt;span style="font-size:0;"&gt;&lt;/span&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;. I have used the VI editor (multiple commands) (n editor, single line) to write shell scripts (which is a group of commands to be executed at once).Command VI opens the editor.(Escape..colon wq) for saving any file and will quit the editor. For executing the shell scripts we write the filename.shI have written a shell script to &lt;a id="AdBriteInlineAd_match" style="BACKGROUND: url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x 50% bottom; MARGIN-BOTTOM: -2px; PADDING-BOTTOM: 2px; CURSOR: pointer; COLOR: #006600; TEXT-DECORATION: none" target="_top" display="inline" keyword="match"&gt;match&lt;/a&gt; a user id to a person’s name.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7. Do you know how to use the VI editor?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. It uses standard alphabetic keys for command. We can create a newfile by this command. VI ‘filename’.In command mode, the letters of the keyboard perform editing functions (like moving the cursor, deleting text, etc.). To enter command mode, press the escape key SAS can effectively be used with Unix operating system. We have some options that would let the programmer to extract files from the terminal as well as save the Output to the terminal.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-5737362651390532252?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/5737362651390532252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=5737362651390532252' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/5737362651390532252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/5737362651390532252'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2008/01/sas-interview-q-proc-sql-and-sas-graph.html' title='SAS interview Q &amp; A: PROC SQl and SAS GRAPH and ODS'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-1193952001300011800</id><published>2008-01-26T00:01:00.000-08:00</published><updated>2008-01-26T00:28:36.585-08:00</updated><title type='text'>SAS Model resumes and SAS Tips and Tricks</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_GO9irZwfG-I/R5rpk_NLK_I/AAAAAAAAAAM/b4rQUFEueNE/s1600-h/sample+resume.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5159693144757578738" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_GO9irZwfG-I/R5rpk_NLK_I/AAAAAAAAAAM/b4rQUFEueNE/s320/sample%2Bresume.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;SAS Model resumes:&lt;a href="http://www.sconsig.com/listresn.htm"&gt;http://www.sconsig.com/listresn.htm&lt;/a&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Leave Ur Ids for SAS Clinical trials resumes.&lt;br /&gt;SAS tips:&lt;a href="http://www.sastips.com/"&gt;http://www.sastips.com/&lt;/a&gt; &lt;a href="http://www.asu.edu/it/fyi/dst/helpdocs/statistics/sas/tips/index.html"&gt;http://www.asu.edu/it/fyi/dst/helpdocs/statistics/sas/tips/index.html&lt;/a&gt;&lt;br /&gt;SAS Hints&lt;br /&gt;&lt;/div&gt;&lt;div&gt;* Delete temporary filesUse proc datasets to delete temporary files created by SAS.&lt;/div&gt;&lt;div&gt;data name;&lt;/div&gt;&lt;div&gt;set name;&lt;/div&gt;&lt;div&gt;run;&lt;/div&gt;&lt;div&gt;SAS code ...proc datasets nolist;&lt;/div&gt;&lt;div&gt;delete name’run;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;* Determine if a file exists&lt;/div&gt;&lt;div&gt;Use %sysexec to spawn a shell&lt;/div&gt;&lt;div&gt;%sysexec /bin/ksh -c "if [ ! -a /etc/passwd ]; then exit 99; else&lt;/div&gt;&lt;div&gt; exit 0; fi;";&lt;/div&gt;&lt;div&gt;%put &amp;sysrc;&lt;/div&gt;&lt;div&gt;orUse filename pipe%let thefile=/etc/passwd;&lt;/div&gt;&lt;div&gt;filename testit pipe "if [ ! -f &amp;amp;thefile ]; then echo 'no';&lt;/div&gt;&lt;div&gt; else echo 'yes'; &lt;/div&gt;&lt;div&gt;fi";data _null_;&lt;/div&gt;&lt;div&gt;infile testit pad missover lrecl=3;&lt;/div&gt;&lt;div&gt;input answer $3.;&lt;/div&gt;&lt;div&gt;put answer=;&lt;/div&gt;&lt;div&gt;run;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;* Direct output to different directory&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Direct SAS output to a directory (other than the one where SAS is being run)&lt;/div&gt;&lt;div&gt;sas –work /different_directory program-name&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;* Errors (specify # of errors for SAS to put into log)Specify the number of errors for SAS to list in the log file in the options line (useful to obtain list of errors, i.e., missing values for markers)&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;options ls=65 ps=55 pageno=1 errors=40&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;* Execute Unix command from SAS&lt;/div&gt;&lt;div&gt;Single Unix commands can be executed by&lt;/div&gt;&lt;div&gt;X command;orcall system (‘command’); &lt;/div&gt;&lt;div&gt;(call system can only be used inside a data step)&lt;/div&gt;&lt;div&gt;Multiple Unix commands can be executed byX ‘command 1; command 2; … command n’;&lt;/div&gt;&lt;div&gt;or&lt;/div&gt;&lt;div&gt;call system (‘command1; command2; … command n’);&lt;/div&gt;&lt;div&gt;%sysexec macro can also be used (macro test will execute Unix commands ‘pwd’ and ‘ls –l’):&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;%macro test%sysexec %str(pwd; ls –l);&lt;/div&gt;&lt;div&gt;%mend test;&lt;/div&gt;&lt;div&gt;%test;X; &lt;/div&gt;&lt;div&gt;(no Unix commands) starts a shell. The user can run programs, check output, etc., then type ‘exit’ to return to SAS.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;* Generate delimited file with no spaces between columns&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;data _NULL_;&lt;/div&gt;&lt;div&gt;set sasdataset;&lt;/div&gt;&lt;div&gt;file "output.txt"; &lt;/div&gt;&lt;div&gt;(or "output.csv")newvar=compress(var1DELIMvar2);&lt;/div&gt;&lt;div&gt;put newvar;&lt;/div&gt;&lt;div&gt;run;&lt;/div&gt;&lt;div&gt;DELIM is comma , or tab ‘09’x&lt;/div&gt;&lt;div&gt;&lt;br /&gt;* Input – Group variables and informats&lt;/div&gt;&lt;div&gt;Informat lists can be grouped when input values are arranged in a pattern. A group informat list consists of 2 lists – the names of the variables to read enclosed in parentheses and the corresponding informats separated by either blanks or commas and enclosed in parentheses.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;If values for the 5 variables SCORE1 through SCORE5 are stored as four columns per value without intervening blanks the input statement is&lt;/div&gt;&lt;div&gt;input (score1-score5) (4.);January 23, 2007 2&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;The +1 column pointer moves the pointer forward one column after X is read. X is read with the 2. informat and the pointer moves to Y, which is read with the 2. informat.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; The pointer then moves to Z, which is read with the 2. informat.&lt;/div&gt;&lt;div&gt;data test;&lt;/div&gt;&lt;div&gt;input (x y z) (2.,+1);&lt;/div&gt;&lt;div&gt;datalines;&lt;/div&gt;&lt;div&gt;2 24 36&lt;/div&gt;&lt;div&gt;0 20 30;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;The n* modifier can be used to specify the number of times to repeat the next informat.&lt;/div&gt;&lt;div&gt;input (name score1-score5) ($10. 5*4.); score will be read in 5 times&lt;/div&gt;&lt;div&gt;&lt;br /&gt;* Noterminal option for PROC EXPORT or PROC IMPORT&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;The message "Error: Cannot open X display" may be received when using PROC IMPORT or PROC EXPORT in batch mode on Unix systems without a terminal present. This can be avoided by using the –noterminal option.sas program-name -noterminal&lt;/div&gt;&lt;div&gt;&lt;br /&gt;* Provide timing and memory usage information&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;fullstimer collects performance statistcs on each SAS job step and for the job as a whole and puts them in the log file. Note: measures are a snapshot view of performance at step and job level; each SAS port yields different fullstimer statistics based on the host operating system.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;sas –fullstimer program-name&lt;/div&gt;&lt;div&gt;Sample result of SAS data step&lt;/div&gt;&lt;div&gt;NOTE: DATA statement used:&lt;/div&gt;&lt;div&gt;real time 0.06 seconds&lt;/div&gt;&lt;div&gt;user cpu time 0.02 seconds&lt;/div&gt;&lt;div&gt;system cpu time 0.00 seconds&lt;/div&gt;&lt;div&gt;Memory 88k&lt;/div&gt;&lt;div&gt;Page Faults 10&lt;/div&gt;&lt;div&gt;Page Reclaims 0&lt;/div&gt;&lt;div&gt;Page Swaps 0&lt;/div&gt;&lt;div&gt;Voluntary Context Switches 22&lt;/div&gt;&lt;div&gt;Involuntary Context Switches 0&lt;/div&gt;&lt;div&gt;Block Input Operations 10&lt;/div&gt;&lt;div&gt;Block Output Operations 12&lt;/div&gt;&lt;div&gt;&lt;br /&gt;* Read in compressed data file using zcat&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;The environment variable ‘$HOME’ is needed (zcat/gunzip uses it in the shell).&lt;/div&gt;&lt;div&gt;filename thedata pipe 'zcat $HOME/datafile.Z';&lt;/div&gt;&lt;div&gt;OR &lt;/div&gt;&lt;div&gt;filename thedata pipe ‘gunzip –c $HOME/datafile.gz’ for gzipped fileddata _null_;&lt;/div&gt;&lt;div&gt;infile thedata pad lrecl=40;&lt;/div&gt;&lt;div&gt;input theline $80.;&lt;/div&gt;&lt;div&gt;put theline=;&lt;/div&gt;&lt;div&gt;run;&lt;/div&gt;&lt;div&gt;run;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;* Read in space/tab delimited filesdata name;&lt;/div&gt;&lt;div&gt;infile use dsd delimiter=" " firstobs=2 truncover;&lt;/div&gt;&lt;div&gt;input heading1 :$10 heading2 $ heading 3 ……;&lt;/div&gt;&lt;div&gt;run;&lt;/div&gt;&lt;div&gt;dlm can be used in place of delimiterTab delimited files: &lt;/div&gt;&lt;div&gt;use dlm=’09’x&lt;/div&gt;&lt;div&gt;Comma delimited files: use dlm=","&lt;/div&gt;&lt;div&gt;firstobs=2 tells SAS to start reading at line 2 (skips header line):$10 – colon tells SAS to read up to the number of characters specified or to the next delimiter, whichever comes first&lt;/div&gt;&lt;div&gt;&lt;br /&gt;* Return the ID of a user in Unix environment&lt;/div&gt;&lt;div&gt;%let person=%sysget(USER);&lt;/div&gt;&lt;div&gt;%put User is &amp;person;&lt;/div&gt;&lt;div&gt;SAS log: User is uniqname&lt;/div&gt;&lt;div&gt;* Return the value of a specified operating environment variable%let homedir=%sysget(HOME); (HOME must be in capital letters)data _null_;&lt;/div&gt;&lt;div&gt;put "The value of my HOME environment variable is: &amp;amp;homedir";&lt;/div&gt;&lt;div&gt;run;&lt;/div&gt;&lt;div&gt;SAS log: The value of my HOME environment variable is: /afs/sph.umich.edu/user/uniqname&lt;/div&gt;&lt;div&gt;&lt;br /&gt;* Rounding in SAS&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;CEIL (ceiling) function (rounds up)Returns the smallest integer &lt;/div&gt;&lt;div&gt;greater than or equal to the argument&lt;/div&gt;&lt;div&gt;data a;&lt;/div&gt;&lt;div&gt;x=2.102;&lt;/div&gt;&lt;div&gt;y=ceil(x);&lt;/div&gt;&lt;div&gt;put x= y=;&lt;/div&gt;&lt;div&gt;run;&lt;/div&gt;&lt;div&gt;Results in: x=2.102 y=3&lt;/div&gt;&lt;div&gt;Floor function (rounds down)&lt;/div&gt;&lt;div&gt;Returns the smallest integer less than or equal to the argument&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;data a;&lt;/div&gt;&lt;div&gt;x=2.102;y=floor(x);&lt;/div&gt;&lt;div&gt;put x= y=;&lt;/div&gt;&lt;div&gt;run;&lt;/div&gt;&lt;div&gt;Results in: x=2.102 y=2&lt;/div&gt;&lt;div&gt;&lt;br /&gt;* Specify a character string to pass to SAS programs using sysparm&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;sas program-name -sysparm dept.projects (sysparm supplies name of data set for proc report)&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;proc report data=&amp;amp;sysparm report=test.resorces.priority.rept;&lt;/div&gt;&lt;div&gt;title "%sysfunc(date(),worddate.)";&lt;/div&gt;&lt;div&gt;title2 'Active Projects By Priority';&lt;/div&gt;&lt;div&gt;run;&lt;/div&gt;&lt;div&gt;SAS sees:&lt;/div&gt;&lt;div&gt;proc report data=dept.projects report=test.resorces.priority.rept;&lt;/div&gt;&lt;div&gt;title "Today’s Date";&lt;/div&gt;&lt;div&gt;title2 'Active Projects By Priority';&lt;/div&gt;&lt;div&gt;run;&lt;/div&gt;&lt;div&gt;or&lt;/div&gt;&lt;div&gt;sas height.sas –sysparm cm&lt;/div&gt;&lt;div&gt;data height;&lt;/div&gt;&lt;div&gt;set height;&lt;/div&gt;&lt;div&gt;if sysparm() = ‘cm’ then do;&lt;/div&gt;&lt;div&gt;height=height*2.54;&lt;/div&gt;&lt;div&gt;unit=‘centimeters’;&lt;/div&gt;&lt;div&gt;end;&lt;/div&gt;&lt;div&gt;run;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;*SAS output (data height contains name, height, and inches as unit)&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;NAME HEIGHT UNIT&lt;/div&gt;&lt;div&gt;John 175.26 centimeters&lt;/div&gt;&lt;div&gt;Sally 162.56 centimeters&lt;/div&gt;&lt;div&gt;Peter 190.50 centimeters&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;* Use SAS with pipes or as a filter under Unix (writing stdout to stdin without using an intermediate file. &lt;/div&gt;&lt;div&gt;See &lt;a href="http://support.sas.com/sassamples/quicktips/pipes_0702.html"&gt;http://support.sas.com/sassamples/quicktips/pipes_0702.html&lt;/a&gt;.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;* Using X commands in Solaris vs. Linux&lt;/div&gt;&lt;div&gt;Solaris – run X program, redirect STDOUT to file, and read file into &lt;/div&gt;&lt;div&gt;SAS dataset:&lt;/div&gt;&lt;div&gt;%let xcomm="getrand -n &amp;amp;numobs &gt; rand.dat";&lt;/div&gt;&lt;div&gt;X &amp;xcomm;&lt;/div&gt;&lt;div&gt;data new;&lt;/div&gt;&lt;div&gt;infile "rand.dat";&lt;/div&gt;&lt;div&gt;input ranu;&lt;/div&gt;&lt;div&gt;run;&lt;/div&gt;&lt;div&gt;Linux – this will only work with the pipe option&lt;/div&gt;&lt;div&gt;%let xcomm="getrand -n &amp;amp;numobs";&lt;/div&gt;&lt;div&gt;filename fromunix pipe &amp;xcomm;&lt;/div&gt;&lt;div&gt;data new;&lt;/div&gt;&lt;div&gt;infile fromunix;&lt;/div&gt;&lt;div&gt;input rannum;&lt;/div&gt;&lt;div&gt;run;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-1193952001300011800?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/1193952001300011800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=1193952001300011800' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1193952001300011800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1193952001300011800'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2008/01/sas-model-resumes-and-sas-tips-and.html' title='SAS Model resumes and SAS Tips and Tricks'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_GO9irZwfG-I/R5rpk_NLK_I/AAAAAAAAAAM/b4rQUFEueNE/s72-c/sample%2Bresume.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-7081011049883846258</id><published>2008-01-25T23:56:00.000-08:00</published><updated>2008-01-26T00:00:29.662-08:00</updated><title type='text'>SAS® and the CDISC (Clinical Data Interchange Standards Consortium)</title><content type='html'>CDISC&lt;br /&gt;&lt;br /&gt;Consortium of Data Interchange Standards Committee (CDISC) is primarily concerned withdeveloping standards that aid in the exchange of information between companies in the BioPharmaecosystems.&lt;br /&gt;&lt;br /&gt;These include the following models:&lt;br /&gt;• Operational Data Model (ODM) —operational support of data collection&lt;br /&gt;• Study Data Tabulation Model (SDTM) —data tabulation data sets&lt;br /&gt;• Case Report Tabulation Data Definition Specification (CRTDDS - aka define.xml)• Laboratory Data Model (Lab)&lt;br /&gt;• Standard for Exchange of Non-clinical Data (SEND)&lt;br /&gt;• BRIDG—Protocol Representation• Analysis Data Model (ADaM) —analysis data structures&lt;br /&gt;• And others… (For example, LAB, SEND)Taken together, these standards and guidelines represent challenges of supporting the clinical researchprocess.&lt;br /&gt;&lt;br /&gt;The importance of data standards Data standards are a critical component in the quest to improve global public health. Inefficiencies in the collection, processing and analysis of patient and health-related information drive up the cost of research and development for life sciences companies as well as negatively impact the cost and quality of healthcare delivery for patients and consumers.&lt;br /&gt;&lt;br /&gt;SAS software support for CDISC standards In addition to helping define CDISC standards, SAS is making certain that our products and solutions support the implementation of CDISC data standards. SAS®9 includes a component called &lt;a href="http://support.sas.com/rnd/base/index-xml-resources.html"&gt;PROC CDISC&lt;/a&gt; that enables organizations running SAS programs to work with CDISC structured data. PROC CDISC supports bi-directional conversion of data content contained in a CDISC ODM XML document to and from SAS-accessible data sources. The current version of PROC CDISC also supports content validation of SAS-accessible data sources to the CDISC SDTM data domain definitions. See &lt;a title="External Link: CDISC Web site" href="http://www.cdisc.org/"&gt;http://www.cdisc.org/&lt;/a&gt; for details on individual format descriptions.&lt;br /&gt;&lt;br /&gt;CDISC standards such as SDTM, ODM, LAB and ADaM can be effectively implemented in solutions like &lt;a href="http://www.sas.com/industry/pharma/develop/index.html"&gt;SAS Drug Development&lt;/a&gt; and &lt;a href="http://www.sas.com/technologies/dw/index.html"&gt;SAS DI Studio&lt;/a&gt;, and we're currently exploring additional ways that these standard processes and data structures can be utilized within our software.&lt;br /&gt;&lt;br /&gt;The SAS XML Libname Engine has been enhanced in SAS 9.1.3 to natively read and write CDISC ODM file content. Using the SAS XML Libname Engine, any data content accessible to SAS may be converted to a CDISC ODM XML document, or conversely, any content in a CDISC ODM XML document may be converted to a SAS dataset or other SAS-accessible data source.&lt;br /&gt;&lt;br /&gt;SAS CDISC implementation services In addition to providing CDISC support within our&lt;br /&gt;software, SAS consultants are ready to help your organization implement CDISC standards to drive efficiencies in your clinical development processes.&lt;br /&gt;&lt;br /&gt;Glossary&lt;br /&gt;&lt;br /&gt;AdaM: Analysis Dataset Model&lt;br /&gt;CDISC: Clinical Data Interchange Standards Consortium&lt;br /&gt;CRT-DDS: Case Report Tabulation Data Definition Specification&lt;br /&gt;LAB: Laboratory Data Model&lt;br /&gt;ODM: Operational Data Model&lt;br /&gt;SDS: Submission Data Standards&lt;br /&gt;SDTM: Study Data Tabulation Model&lt;br /&gt;XML: eXtensible Markup Language&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_yE2Kw6HT3CA/R2iHWgitW4I/AAAAAAAAAEc/kli7zLPE6GA/s1600-h/CDISC.gif"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-7081011049883846258?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/7081011049883846258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=7081011049883846258' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/7081011049883846258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/7081011049883846258'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2008/01/sas-and-cdisc-clinical-data-interchange.html' title='SAS® and the CDISC (Clinical Data Interchange Standards Consortium)'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-4956164044639140274</id><published>2008-01-25T23:49:00.000-08:00</published><updated>2008-01-25T23:55:25.102-08:00</updated><title type='text'>Base SAS Certification Exam Model Questions:</title><content type='html'>&lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665171299607123.html"&gt;Base SAS 1&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665145620634749.html"&gt;Base SAS 2&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665140110232963.html"&gt;Base SAS 3&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665131632684295.html"&gt;Base SAS 4&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665126367376582.html"&gt;Base SAS 5&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665119677721861.html"&gt;Base SAS 6&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665113581391155.html"&gt;Base SAS 7&lt;/a&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665108189070877.html"&gt;Base SAS 8&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665099861461678.html"&gt;Base SAS 9&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665094731072839.html"&gt;Base SAS 10&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665088161675565.html"&gt;Base SAS 11&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665083010371927.html"&gt;Base SAS 12&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665076406497800.html"&gt;Base SAS 13&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665066597273219.html"&gt;Base SAS 14&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665044814065072.html"&gt;Base SAS 15&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665039782498991.html"&gt;Base SAS 16&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665034745852752.html"&gt;Base SAS 17&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665027680367036.html"&gt;Base SAS 18&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665021010488489.html"&gt;Base SAS 19&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665016461148886.html"&gt;Base SAS 20&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665012143647774.html"&gt;Base SAS 21&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665006371351821.html"&gt;Base SAS 22&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116665000482667031.html"&gt;Base SAS 23&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116664990905035899.html"&gt;Base SAS 24&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116664965959672750.html"&gt;Base SAS 25&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116664955461232658.html"&gt;Base SAS 27&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116664943070030959.html"&gt;Base SAS 28&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116664936393582546.html"&gt;Base SAS 29&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116664878438547848.html"&gt;Base SAS 30&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116664873215833283.html"&gt;Base SAS 31&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116664868514970968.html"&gt;Base SAS 32&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116664862234205808.html"&gt;Base SAS 33&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116664856276250063.html"&gt;Base SAS 34&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116664850723185811.html"&gt;Base SAS 35&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116664843451215561.html"&gt;Base SAS 36&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116664834146885055.html"&gt;Base SAS 37&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116664827513857589.html"&gt;Base SAS 38&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_20.html"&gt;Base SAS 39&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656460621451219.html"&gt;Base SAS 40&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656434626435903.html"&gt;Base SAS 41&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656423119317088.html"&gt;Base SAS 42&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656411032515152.html"&gt;Base SAS 43&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656383956117470.html"&gt;Base SAS 44&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656376342222191.html"&gt;Base SAS 45&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656355396157930.html"&gt;Base SAS 46&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656343667578469.html"&gt;Base SAS 47&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656331612857685.html"&gt;Base SAS 48&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656303224663555.html"&gt;Base SAS 49&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656242274927530.html"&gt;Base SAS 50&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656232131059671.html"&gt;Base SAS 51&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656226100172339.html"&gt;Base SAS 52&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656218918085782.html"&gt;Base SAS 53&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656186780923426.html"&gt;Base SAS 54&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656179468250480.html"&gt;Base SAS 55&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656169214386642.html"&gt;Base SAS 56&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116656141079585172.html"&gt;Base SAS 57&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653841429017433.html"&gt;Base SAS 58&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653834667310217.html"&gt;Base SAS 59&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653828041246371.html"&gt;Base SAS 60&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653821754245848.html"&gt;Base SAS 61&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653812777125239.html"&gt;Base SAS 62&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653805814321842.html"&gt;Base SAS 63&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653794723518513.html"&gt;Base SAS 64&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653786494277652.html"&gt;Base SAS 65&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653776656673665.html"&gt;Base SAS 66&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653769923986736.html"&gt;Base SAS 67&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653759720478487.html"&gt;Base SAS 68&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653752692932683.html"&gt;Base SAS 69&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653741550111807.html"&gt;Base SAS 70&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653728455355017.html"&gt;Base SAS 71&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653717981123520.html"&gt;Base SAS 72&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653706502921561.html"&gt;Base SAS 73&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653698681018962.html"&gt;Base SAS 74&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653690503422423.html"&gt;Base SAS 75&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653684740919296.html"&gt;Base SAS 76&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653679535861332.html"&gt;Base SAS 77&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653661787148677.html"&gt;Base SAS 78&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653655081781074.html"&gt;Base SAS 79&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653649049635971.html"&gt;Base SAS 80&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653641731059802.html"&gt;Base SAS 81&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653635407275464.html"&gt;Base SAS 82&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653624155371974.html"&gt;Base SAS 83&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653612740015937.html"&gt;Base SAS 84&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653606015295382.html"&gt;Base SAS 85&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653599626276306.html"&gt;Base SAS 86&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653586084114907.html"&gt;Base SAS 87&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653578038985554.html"&gt;Base SAS 88&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653565115764095.html"&gt;Base SAS 89&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653539696211468.html"&gt;Base SAS 90&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653534418493530.html"&gt;Base SAS 91&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653520209162579.html"&gt;Base SAS 92&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653511418250572.html"&gt;Base SAS 93&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/following-sas-program-is-submitted.html"&gt;Base SAS 94&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653493720851989.html"&gt;Base SAS 95&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653482642191561.html"&gt;Base SAS 96&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653474202757700.html"&gt;Base SAS 97&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116653466217730697.html"&gt;Base SAS 98&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_19.html"&gt;Base SAS 99&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116630700956301838.html"&gt;Base SAS 100&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116630694040679295.html"&gt;Base SAS 101&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116630676887975363.html"&gt;Base SAS 102&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116630658126000222.html"&gt;Base sas 103&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116630532557406583.html"&gt;Base SAS 104&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116630508906579290.html"&gt;Base SAS 105&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116630501738879771.html"&gt;Base SAS 106&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116630486129711205.html"&gt;Base SAS 107&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116630483100555915.html"&gt;Base SAS 108&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_116630480318618019.html"&gt;Base SAS 109&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas_16.html"&gt;Base SAS 110&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-sas.html"&gt;Base SAS 111&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-question_116630449457135276.html"&gt;Base SAS 112&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-question_116630075036574643.html"&gt;Base SAS 113&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-question_116629934404543841.html"&gt;Base SAS 114&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-question_116629930096928139.html"&gt;Base SAS 115&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-question_116629926698825920.html"&gt;Base SAS 116&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-question_116629920731505920.html"&gt;Base SAS 117&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-question_116629104869399476.html"&gt;Base SAS 26&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sascert.blogspot.com/2006/12/base-question_16.html"&gt;Base SAS 118&lt;/a&gt; &lt;a href="http://sascert.blogspot.com/2006/12/base-question.html"&gt;Base SAS 119&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-4956164044639140274?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/4956164044639140274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=4956164044639140274' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/4956164044639140274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/4956164044639140274'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2008/01/base-sas-certification-exam-model.html' title='Base SAS Certification Exam Model Questions:'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-363970996731553263</id><published>2008-01-25T23:46:00.000-08:00</published><updated>2008-01-25T23:49:25.919-08:00</updated><title type='text'>What is SAS?</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_yE2Kw6HT3CA/R0IQ5fNN2fI/AAAAAAAAABI/Zo_4NuMNuPQ/s1600-h/saslogo.gif"&gt;&lt;/a&gt;&lt;a href="http://3.bp.blogspot.com/_yE2Kw6HT3CA/R0IQ5fNN2fI/AAAAAAAAABI/Zo_4NuMNuPQ/s1600-h/saslogo.gif"&gt;&lt;/a&gt;&lt;br /&gt;The SAS System (originally Statistical Analysis System) is an integrated system of software products provided by &lt;a title="SAS Institute" href="http://en.wikipedia.org/wiki/SAS_Institute"&gt;SAS Institute&lt;/a&gt; that enables the programmer to perform:&lt;br /&gt;&lt;br /&gt;&lt;a title="Data entry" href="http://en.wikipedia.org/wiki/Data_entry"&gt;data entry&lt;/a&gt;, &lt;a title="Information retrieval" href="http://en.wikipedia.org/wiki/Information_retrieval"&gt;retrieval&lt;/a&gt;, &lt;a title="Data management" href="http://en.wikipedia.org/wiki/Data_management"&gt;management&lt;/a&gt;, and &lt;a title="Data mining" href="http://en.wikipedia.org/wiki/Data_mining"&gt;mining&lt;/a&gt;&lt;a title="Report" href="http://en.wikipedia.org/wiki/Report"&gt;report&lt;/a&gt;&lt;br /&gt; writing and graphics&lt;a title="Statistics" href="http://en.wikipedia.org/wiki/Statistics"&gt;statistical&lt;/a&gt; and &lt;a title="Mathematical analysis" href="http://en.wikipedia.org/wiki/Mathematical_analysis"&gt;mathematical analysis&lt;/a&gt;&lt;a title="Business plan" href="http://en.wikipedia.org/wiki/Business_plan"&gt;business planning&lt;/a&gt;,&lt;br /&gt;&lt;a title="Forecasting" href="http://en.wikipedia.org/wiki/Forecasting"&gt;forecasting&lt;/a&gt;, and &lt;a title="Decision support system" href="http://en.wikipedia.org/wiki/Decision_support_system"&gt;decision support&lt;/a&gt;&lt;a title="Operations research" href="http://en.wikipedia.org/wiki/Operations_research"&gt;operations research&lt;/a&gt; and&lt;br /&gt;&lt;a title="Project management" href="http://en.wikipedia.org/wiki/Project_management"&gt;project management&lt;/a&gt;&lt;a title="Quality control" href="http://en.wikipedia.org/wiki/Quality_control"&gt;quality improvement&lt;/a&gt;&lt;a title="Application software" href="http://en.wikipedia.org/wiki/Application_software"&gt;applications&lt;/a&gt;&lt;br /&gt;development&lt;a title="Data warehousing" href="http://en.wikipedia.org/wiki/Data_warehousing"&gt;Data warehousing&lt;/a&gt; (&lt;a title="Extract, transform, load" href="http://en.wikipedia.org/wiki/Extract%2C_transform%2C_load"&gt;extract, transform, load&lt;/a&gt;)&lt;a title="Platform independent" href="http://en.wikipedia.org/wiki/Platform_independent"&gt;platform independent&lt;/a&gt;&lt;br /&gt;and &lt;a title="Remote control software" href="http://en.wikipedia.org/wiki/Remote_control_software"&gt;remote computing&lt;/a&gt;&lt;br /&gt;In addition, the SAS System integrates with many SAS business solutions that enable large scale software solutions for areas&lt;br /&gt;such as &lt;a title="Human resource management" href="http://en.wikipedia.org/wiki/Human_resource_management"&gt;human resource management&lt;/a&gt;, &lt;a title="Financial management" href="http://en.wikipedia.org/wiki/Financial_management"&gt;financial management&lt;/a&gt;,&lt;br /&gt;&lt;a title="Business intelligence" href="http://en.wikipedia.org/wiki/Business_intelligence"&gt;business intelligence&lt;/a&gt;, &lt;a title="Customer relationship management" href="http://en.wikipedia.org/wiki/Customer_relationship_management"&gt;customer relationship management&lt;/a&gt; and more.&lt;br /&gt;&lt;br /&gt;Discovering and developing safe and effective new medicines is a long, difficult and expensive process:&lt;br /&gt;&lt;br /&gt;Preclinical Testing --&gt; Investigational New Drug Application (IND) --&gt; Clinical Trials, Phase- I --&gt; Phase-II --&gt; Phase-III --&gt; New Drug Application (NDA) --&gt; Approval --&gt; Phase-IV.&lt;br /&gt;&lt;br /&gt;SAS-programming is very important from preclinical testing to approval stages.&lt;br /&gt; Here, when you see the sequence of drug development and approval process you can yourself realize how important clinical trials and SAS-programming areas are and there is an urgent need of starting training programs in these areas.&lt;br /&gt;&lt;br /&gt;Training program on how to effectively monitor clinical trials can be designed based on Good Clinical Practices and ICH guidelines.&lt;br /&gt;Various topics may include: design of protocol, case report forms, reporting serious adverse events, early phase clinical evaluation, processing clinical research data, clinical database, data display, report and analysis plan, clinical trial report, standard operating procedures in regulatory affairs, auditing of clinical trials and new drug application etc.&lt;br /&gt;&lt;br /&gt;Clinical trials data arriving on case report forms is fairly standard, for example demography, adverse event, medications, laboratory etc hence can be stored in fairly standard data structures. Designing clinical data structures for data entry is important, but it should be done with some understanding of the analysis that will be performed. Once an appropriate clinical data structure is arrived at for data entry, it is important to then determine how to best use the data in the SAS analysis environment.&lt;br /&gt;&lt;br /&gt;US FDA considers SAS validation an important component of the quality assurance, reliability &amp;amp; accuracy of much of the information used to approve &amp;amp; develop drugs and medical devices. Hot spots and crucial points in pharmaceutical research &amp;amp; developments are submission of various clinical reports to FDA and these clinical reports need to be created using SAS-programming techniques.&lt;br /&gt;&lt;br /&gt;Different Phases in Clinical trilas and SAS programming include:&lt;br /&gt;(1) Clinical Report Generation for example:&lt;br /&gt;(a) Adverse Event tables and listings,&lt;br /&gt;(b) Demographics,&lt;br /&gt;(c) Safety,&lt;br /&gt;(d) Efficacy,&lt;br /&gt;(e) Lab Data,&lt;br /&gt;(2) Custom Derived SAS data sets,&lt;br /&gt;(3) SAS-Programming for NDAs (New Drug Applications),&lt;br /&gt;(4) Experience with Phases I-IV,&lt;br /&gt;(5) Data Cleaning,&lt;br /&gt;(6) Statistical Analysis using SAS tools and&lt;br /&gt;(7) Data Warehousing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-363970996731553263?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/363970996731553263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=363970996731553263' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/363970996731553263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/363970996731553263'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2008/01/what-is-sas.html' title='What is SAS?'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-1192117630772204292</id><published>2008-01-25T23:42:00.000-08:00</published><updated>2008-01-25T23:46:13.637-08:00</updated><title type='text'>Resources from where you can learn SAS online:</title><content type='html'>&lt;a href="http://www.ats.ucla.edu/stat/sas/"&gt;http://www.ats.ucla.edu/stat/sas/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.psych.yorku.ca/lab/sas/"&gt;http://www.psych.yorku.ca/lab/sas/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://learn.sdstate.edu/Dwight_Galster/510docs/Tutorial%"&gt;http://learn.sdstate.edu/Dwight_Galster/510docs/Tutorial%&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;20Programs/sas_tutorial_contents.htm/&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.itc.virginia.edu/research/sas/training/v8/"&gt;http://www.itc.virginia.edu/research/sas/training/v8/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.umanitoba.ca/centres/mchp/teaching/sasmanual/"&gt;http://www.umanitoba.ca/centres/mchp/teaching/sasmanual/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;SAS tutorial for UNIX:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://its.unm.edu/introductions/Sas_tutorial/"&gt;http://its.unm.edu/introductions/Sas_tutorial/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-1192117630772204292?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/1192117630772204292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=1192117630772204292' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1192117630772204292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1192117630772204292'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2008/01/resources-from-where-you-can-learn-sas.html' title='Resources from where you can learn SAS online:'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-1961923826955848127</id><published>2008-01-25T20:03:00.000-08:00</published><updated>2008-01-25T23:42:11.997-08:00</updated><title type='text'>SAS MACROS  Q &amp; A</title><content type='html'>&lt;strong&gt;1. Have you used macros? For what purpose you have used?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Yes I have, I used macros in creating analysis datasets and tables where it is necessary to make a small change through out the program and where it is necessary to use the code again and again.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. How would you invoke a macro?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;After I have defined a macro I can invoke it by adding the percent sign prefix to its name like this: % macro name a semicolon is not required when invoking a macro, though adding one generally does no harm.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. How we can call macros with in data step?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;We can call the macro with CALLSYMPUT&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. How do u identify a macro variable?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ampersand (&amp;amp;)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. How do you define the end of a macro?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The end of the macro is defined by %Mend Statement&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6. For what purposes have you used SAS macros?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;If we want use a program step for executing to execute the same Proc step on multiple data sets. We can accomplish repetitive tasks quickly and efficiently. A macro program can be reused many times. Parameters passed to the macro program customize the results without having to change the code within the macro program. Macros in SAS make a small change in the program and have SAS echo that change thought that program.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7. What is the difference between %LOCAL and %GLOBAL?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;% Local is a macro variable defined inside a macro.%Global is a macro variable defined in open code (outside the macro or can use anywhere).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;8. How long can a macro variable be? A token?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;A component of SAS known as the word scanner breaks the program text into fundamental units called tokens.· Tokens are passed on demand to the compiler.· The compiler then requests token until it receives a semicolon.· Then the compiler performs the syntax check on the statement.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;9. If you use a SYMPUT in a DATA step, when and where can you use the macro variable?&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;Macro variable is used inside the Call Symput statement and is enclosed in quotes.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;10. What do you code to create a macro?&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;End one?%MACRO and %MEND.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;11. What is the difference between %PUT and SYMBOLGEN?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;%PUT is used to display user defined messages on log window after execution of a program where as % SYMBOLGEN is used to print the value of a macro variable resolved, on log window.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;12. How do you add a number to a macro variable?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Using %eval function&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;13. Can you execute a macro within a macro? Describe.&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Yes, Such macros are called nested macros. They can be obtained by using symget and call symput macros.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;14. If you need the value of a variable rather than the variable itself what would you use to load the value to a macro variable?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;If we need a value of a macro variable then we must define it in such terms so that we can call them everywhere in the program. Define it as Global. There are different ways of assigning a global variable. Simplest method is %LET.&lt;br /&gt;&lt;br /&gt;Ex:A, is macro variable. Use following statement to assign the value of a rather than the variable itselfe.g.%Let A=xyzx="&amp;amp;A";This will assign "xyz" to x, not the variable xyz to x.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;15. Can you execute macro within another macro? If so, how would SAS know where the current macro ended and the new one began?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Yes, I can execute macro within a macro, what we call it as nesting of macros, which is allowed. Every macro's beginning is identified the keyword %macro and end with %mend.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;16. How are parameters passed to a macro?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;A macro variable defined in parentheses in a %MACRO statement is a macro parameter. Macro parameters allow you to pass information into a macro.&lt;br /&gt;Here is a simple example:&lt;br /&gt;%macro plot(yvar= ,xvar= );&lt;br /&gt;proc plot;&lt;br /&gt;plot &amp;amp;yvar*&amp;xvar;&lt;br /&gt;run;&lt;br /&gt;%mend plot;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;17. How would you code a macro statement to produce information on the SAS log?This statement can be coded anywhere?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;OPTIONS, MPRINT MLOGIC MERROR SYMBOLGEN;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;18. How we can call macros with in data step?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;We can call the macro with CALLSYMPUT, Proc SQL and %LET statement.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;19. Tell me about call symput?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;CALL SYMPUT takes a value from a data step and assigns it to a macro variable. I can then use this macro variable in later steps. To assign a value to a single macro variable, I use CALL SYMPUT with this general form:&lt;br /&gt;&lt;br /&gt;CALL SYMPUT (“macro-variable-name”, value);Where macro-variable-name, enclosed in quotation marks, is the name of a macro variable, either new or old, and value is the value I want to assign to that macro variable. Value can be the name of a variable whose value SAS will use, or it can be a constant value enclosed quotation marks.&lt;br /&gt;&lt;br /&gt;CALL SYMPUT is often used in if-then statements such as this:If age&gt;=18 then call symput (“status”,”adult”);Else call symput (“status”,”minor”);These statements create a macro variable named &amp;amp;status and assign to it a value of either adult or minor depending on the variable age.&lt;br /&gt;&lt;br /&gt;Caution: We cannot create a macro variable with CALL SYMPUT and use it in the same data step because SAS does not assign a value to the macro variable until the data step executes. Data steps executes when SAS encounters a step boundary such as a subsequent data, proc, or run statement.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;20. Tell me about % include and % eval?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The %include statement, despite its percent sign, is not a macro statement and is always executed in SAS, though it can be conditionally executed in a macro.It can be used to setting up a macro library. But this is a least approach.&lt;br /&gt;The use of %include does not actually set up a library. The %include statement points to a file and when it executed the indicated file (be it a full program, macro definition, or a statement fragment) is inserted into the calling program at the location of the call.&lt;br /&gt;&lt;br /&gt;When using the %include building a macro library, the included file will usually contain one or more macro definitions.%EVAL is a widely used yet frequently misunderstood SAS(r) macro language function due to its seemingly simple form. However, when its actual argument is a complex macro expression interlaced with special characters, mixed arithmetic and logical operators, or macro quotation functions, its usage and result become elusive and problematic. %IF condition in macro is evaluated by %eval, to reduce it to true or false.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;21. Describe the ways in which you can create macro variables?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;There are the 5 ways to create macro variables:%Let%GlobalCall SymputProc SQlParameters.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;22. Tell me more about the parameters in macro?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Parameters are macro variables whose value you set when you invoke a macro. To add the parameters to a macro, you simply name the macro vars names in parenthesis in the %macro statement.&lt;br /&gt;Syntax:&lt;br /&gt;%MACRO macro-name (parameter-1= , parameter-2= , ……parameter-n = );&lt;br /&gt;macro-text&lt;br /&gt;%MEND macro-name;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;23. What is the maximum length of the macro variable?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;32 characters long.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;24. Automatic variables for macro?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Every time we invoke SAS, the macro processor automatically creates certain macro var. eg: &amp;amp;sysdate &amp;amp;sysday.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;25. What system options would you use to help debug a macro?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Debugging a Macro with SAS System Options. The SAS System offers users a number of useful system options to help debug macro issues and problems. The results associated with using macro options are automatically displayed on the SAS Log. Specific options related to macro debugging appear in alphabetical order in the table below.SAS Option Description:&lt;br /&gt;&lt;br /&gt;MEMRPT Specifies that memory usage statistics be displayed on the SAS Log.&lt;br /&gt;MERROR: SAS will issue warning if we invoke a macro that SAS didn’t find. Presents Warning Messages when there are misspellings or when an undefined macro is called.&lt;br /&gt;SERROR: SAS will issue warning if we use a macro variable that SAS can’t find.&lt;br /&gt;MLOGIC: SAS prints details about the execution of the macros in the log.&lt;br /&gt;MPRINT: Displays SAS statements generated by macro execution are traced on the SAS Log for debugging purposes.&lt;br /&gt;SYMBOLGEN: SAS prints the value of macro variables in log and also displays text from expanding macro variables to the SAS Log.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;26. If you need the value of a variable rather than the variable itself what would you use to load the value to a macro variable?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;If we need a value of a macro variable then we must define it in such terms so that we can call them everywhere in the program. Define it as Global. There are different ways of assigning a global variable.&lt;br /&gt;Simplest method is %LET.&lt;br /&gt;Ex:A, is macro variable. Use following statement to assign the value of a rather than the variable itself&lt;br /&gt;e.g.&lt;br /&gt;%Let A=xyzx="&amp;amp;A";&lt;br /&gt;&lt;br /&gt;This will assign "xyz" to x, not the variable xyz to x.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;27. Can you execute macro within another macro? If so, how would SAS know where the current macro ended and the new one began?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Yes, I can execute macro within a macro, what we call it as nesting of macros, which is allowed. Every macro's beginning is identified the keyword %macro and end with %mend.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;28. How are parameters passed to a macro?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;A macro variable defined in parentheses in a %MACRO statement is a macro parameter. Macro parameters allow you to pass information into a macro.&lt;br /&gt;Here is a simple example:&lt;br /&gt;%macro plot(yvar= ,xvar= );&lt;br /&gt;proc plot;&lt;br /&gt;plot &amp;amp;yvar*&amp;xvar;&lt;br /&gt;run;&lt;br /&gt;%mend plot;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;29. How would you code a macro statement to produce information on the SAS log?This statement can be coded anywhere?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;OPTIONS, MPRINT MLOGIC MERROR SYMBOLGEN;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;30. How we can call macros with in data step?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;We can call the macro with CALLSYMPUT, Proc SQL and %LET statement.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;31. What are SYMGET and SYMPUT?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;SYMPUT puts the value from a dataset into a macro variable where as SYMGET gets the value from the macro variable to the dataset.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;32. What are the macros you have used in your programs?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Used macros for various puposes, few of them are..1) Macros written to determine the list of variables in a dataset:&lt;br /&gt;%macro varlist (dsn);&lt;br /&gt;proc contents data = &amp;amp;dsn out = cont noprit;&lt;br /&gt;run;&lt;br /&gt;proc sql noprint;&lt;br /&gt;select distinct name into:varname1-:varname22from cont;&lt;br /&gt;quit;&lt;br /&gt;%do i =1 %to &amp;sqlobs;&lt;br /&gt;%put &amp;amp;i &amp;amp;&amp;amp;varname&amp;i;&lt;br /&gt;%end;&lt;br /&gt;%mend varlist;&lt;br /&gt;%varlist(adverse)&lt;br /&gt;2) Distribution or Missing / Non-Missing Values%macro missrep(dsn, vars=_numeric_);&lt;br /&gt;proc freq data=&amp;amp;dsn.;&lt;br /&gt;tables &amp;amp;vars. / missing;format _character_ $missf. _numeric_ missf.;&lt;br /&gt;title1 ‘Distribution or Missing / Non-Missing Values’;&lt;br /&gt;run;&lt;br /&gt;%mend missrep;%missrep(study.demog, vars=age gender bdate);&lt;br /&gt;3) Written macros for sorting common variables in various datasets%macro sortit (datasetname, pid, investigator, timevisit)PROC SORT DATA = &amp;DATASETNAME;BY &amp;amp;PID &amp;INVESTIGATOR;%mend sortit;&lt;br /&gt;4) Macros written to split the number of observations in a dataset%macro split (dsnorig, dsnsplit1, dsnsplit2, obs1);&lt;br /&gt;data &amp;dsnsplit1;set &amp;amp;dsnorig (obs = &amp;amp;obs1);&lt;br /&gt;run;&lt;br /&gt;data &amp;dsnsplit2;&lt;br /&gt;set &amp;amp;dsnorig (firstobs = %eval(&amp;amp;obs1 + 1));&lt;br /&gt;run;&lt;br /&gt;%mend split;&lt;br /&gt;%split(sasuser.admit,admit4,admit5,2)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;33. What is auto call macro and how to create a auto call macro? What is the use of it? How to use it in SAS with macros?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Enables the user to call macros that have been stored as SAS programs. The auto call macro facility allows users to access the same macro code from multiple SAS programs. Rather than having the same macro code for in each program where the code is required, with an autocall macro, the code is in one location.&lt;br /&gt;&lt;br /&gt;This permits faster updates and better consistency across all the programs.Macro set-up:The fist step is to set-up a program that contains a macro, desired to be used in multiple programs. Although the program may contain other macros and/or open code, it is advised to include only one macro.&lt;br /&gt;&lt;br /&gt;Set MAUTOSOURSE and SASAUTOS:Before one can use the autocall macro within a SAS program, The MAUTOSOURSE option must be set open and the SASAUTOS option should be assigned. The MAUTOSOURSE option indicates to SAS that the autocall facility is to be activated.&lt;br /&gt;The SASAUTOS option tells SAS where to look for the macros.&lt;br /&gt;For ex: sasauto=’g:\busmeas\internal\macro\’;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;34. What %put do?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;It displays the macro variable value when we specify%put (my first macro variable… is &amp;amp;……..)% Put _automatic_ option displays all the SAS system macro variables includind &amp;amp;SYSDATE AND &amp;amp;SYSTIME.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-1961923826955848127?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/1961923826955848127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=1961923826955848127' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1961923826955848127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1961923826955848127'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2008/01/sas-macros-q.html' title='SAS MACROS  Q &amp; A'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-8685409738442407951</id><published>2008-01-25T03:17:00.000-08:00</published><updated>2008-01-25T23:37:50.551-08:00</updated><title type='text'>SAS Clinical Questions</title><content type='html'>&lt;strong&gt;1.Describe the phases of clinical trials?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans:- These are the following four phases of the clinical trials:&lt;br /&gt;Phase 1: Test a new drug or treatment to a small group of people (20-80) to evaluate its safety.&lt;br /&gt;&lt;br /&gt;Phase 2: The experimental drug or treatment is given to a large group of people (100-300) to see that the drug is effective or not for that treatment.&lt;br /&gt;&lt;br /&gt;Phase 3: The experimental drug or treatment is given to a large group of people (1000-3000) to see its effectiveness, monitor side effects and compare it to commonly used treatments.&lt;br /&gt;&lt;br /&gt;Phase 4: The 4 phase study includes the post marketing studies including the drug's risk, benefits etc.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Describe the validation procedure? How would you perform the validation for TLG as well as analysis data set?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans:- Validation procedure is used to check the output of the SAS program, generated by the source programmer. In this process validator write the program and generate the output. If this output is same as the output generated by the SAS programmer's output then the program is considered to be valid. We can perform this validation for TLG by checking the output manually and for analysis data set it can be done using PROC COMPARE.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. How would you perform the validation for the listing, which has 400 pages?&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;Ans:- It is not possible to perform the validation for the listing having 400 pages manually. To do this, we convert the listing in data sets by using PROC RTF and then after that we can compare it by using PROC COMPARE.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Can you use PROC COMPARE to validate listings? Why?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans:- Yes, we can use PROC COMPARE to validate the listing because if there are many entries (pages) in the listings then it is not possible to check them manually. So in this condition we use PROC COMPARE to validate the listings.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. How would you generate tables, listings and graphs?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans:- We can generate the listings by using the PROC REPORT. Similarly we can create the tables by using PROC FREQ, PROC MEANS, and PROC TRANSPOSE and PROC REPORT. We would generate graph, using proc Gplot etc.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6. How many tables can you create in a day?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans:- Actually it depends on the complexity of the tables if there are same type of tables then, we can create 4-5 tables in a day.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7. What are all the PROCS have you used in your experience?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans:- I have used many procedures like proc report, proc sort, proc format etc. I have used proc report to generate the list report, in this procedure I have used subjid as order variable and trt_grp, sbd, dbd as display variables.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;8. Describe the data sets you have come across in your life?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans:- I have worked with demographic, adverse event , laboratory, analysis and other data sets.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;9. How would you submit the docs to FDA? Who will submit the docs?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans:- We can submit the docs to FDA by e-submission. Docs can be submitted to FDA using21 CRF part 11 forms. In this doc we have the documentation about macros and program and E-records also. Statistician or project manager will submit this doc to FDA.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;10. What are the docs do you submit to FDA?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans:- We submit ISS and ISE documents to FDA.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;11. Can u share your CDISC experience? What version of CDISC have you used?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans: I didn't get any chance to work in CDISC extensively. But I have helped my project manager and statistician in CDISC. I have used version 3 of the CDISC.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;12. Tell me the importance of the SAP?&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;Ans:- This document contains detailed information regarding study objectives and statistical methods to aid in the production of the Clinical Study Report (CSR) including summary tables, figures, and subject data listings for Protocol. This document also contains documentation of the program variables and algorithms that will be used to generate summary statistics and statistical analysis.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;13. Tell me about your project group? To whom you would report/contact?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans:-My project group consisting of six members, a project manager, two statisticians, lead programmer and two programmers.I would report to the lead programmer. If I have any problem regarding the programming I would contact the lead programmer. If I have any doubt in values of variables in raw dataset I would contact the statistician. For example the dataset related to the menopause symptoms in women, if the variable sex having the values like F, M. I would consider it as wrong; in that type of situations I would contact the statistician.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;14. Explain SAS documentation.&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans:-SAS documentation includes programmer header, comments, titles, footnotes etc. Whatever we type in the program for making the program easily readable, easily understandable are in called as SAS documentation.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;15. How would you know whether the program has been modified or not?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ans:-I would know the program has been modified or not by seeing the modification history in the program header.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;16. Project status meeting?&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;Ans:It is a planetary meeting of all the project managers to discuss about the present Status of the project in hand and discuss new ideas and options in improving the Way it is presently being performed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;17. Describe clin-trial data base and oracle clinicalClintrial?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans:-Tthe market's leading Clinical Data Management System (CDMS).Oracle Clinical or OC is a database management system designed by Oracle to provide data management, data entry and data validation functionalities to Clinical Trials process.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;18. Tell me about MEDRA and what version of MEDRA did you use in your project?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans:-Medical dictionary of regulatory activities. Version 10&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;19. Describe SDTM?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans:-CDISC’s Study Data Tabulation Model (SDTM) has been developed to standardize what is submitted to the FDA.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;20. What is CRT?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans:-Case Report Tabulation.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;21. What is annotated CRF?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Case report form, it’s a collection of the forms of all the patients in the trial.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;22. What do you know about 21CRF PART 11?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a title="Title 21 of the Code of Federal Regulations" href="http://en.wikipedia.org/wiki/Title_21_of_the_Code_of_Federal_Regulations"&gt;Title 21 CFR&lt;/a&gt; Part 11 of the &lt;a title="Code of Federal Regulations" href="http://en.wikipedia.org/wiki/Code_of_Federal_Regulations"&gt;Code of Federal Regulations&lt;/a&gt; deals with the &lt;a title="FDA" href="http://en.wikipedia.org/wiki/FDA"&gt;FDA&lt;/a&gt; guidelines on electronic records and &lt;a title="Electronic signature" href="http://en.wikipedia.org/wiki/Electronic_signature"&gt;electronic signatures&lt;/a&gt; in the &lt;a title="United States" href="http://en.wikipedia.org/wiki/United_States"&gt;United States&lt;/a&gt;. Part 11, as it is commonly called, defines the criteria under which electronic records and electronic signatures are considered to be trustworthy, reliable and equivalent to paper records.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;23. Have you did validation in your projects?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;I did validation of the fellow programmers work to ensure that the logic and intent of the program is correct and that data errors are detected.e.gVerify error and warning messages are generated when the macro is called more than 10 times which means to add more than 10 titles. Verify the error message when TITLENUM parameter is invalid.Verify a warning message is generated if the total length of texts specified in the input parameters LEFT, CENTER, and RIGHT is greater than 132 characters. Also verify precedence is given to string in input parameter LEFT if the total string length is more than 132 characters.Verify there is no error/warning message generated if the macro is used within a data step and all input parameters are valid.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;24. What are the contents of AE dataset? What is its purpose? What are the variables in adverse event datasets?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The adverse event data set contains the SUBJID, body system of the event, the preferred term for the event, event severity. The purpose of the AE dataset is to give a summary of the adverse event for all the patients in the treatment arms to aid in the inferential safety analysis of the drug.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;25. What are the contents of lab data? What is the purpose of data set?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The lab data set contains the SUBJID, week number, and category of lab test, standard units, low normal and high range of the values. The purpose of the lab data set is to obtain the difference in the values of key variables after the administration of drug.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How did you do data cleaning? How do you change the values in the data on your own?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;I used proc freq and proc univariate to find the discrepancies in the data, which I reported to my manager.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;26.Tell me about this company in India? How big it is? Why are they using SAS?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;CENTRAL DRUGS STANDARD CONTROL ORGANIZATIONHuman/Clinical pharmacology trials (phase I)Exploratory trials (Phase II)Confirmatory trials (Phase III)About ACT – turnover of around $30 million dollars. Headquarters in India.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;27.Have you created CRT’s, if you have, tell me what have you done in that?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Yes I have created patient profile tabulations as the request of my manager and and the statistician. I have used PROC REPORT and Proc SQl to create simple patient listing which had all information of a particular patient including age, sex, race etc.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;28. Have you created transport files?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Yes, I have created SAS Xport transport files using Proc Copy and data step for the FDA submissions. These are version 5 files. we use the libname engine and the Proc Copy procedure, One dataset in each xport transport format file. For version 5: labels no longer than 40 bytes, variable names 8 bytes, character variables width to 200 bytes. If we violate these constraints your copy procedure may terminate with constraints, because SAS xport format is in compliance with SAS 5 datasets.Libname sdtm “c:\sdtm_data”;Libname dm xport “c:\dm.xpt”;Proc copy;In = sdtm;Out = dm;Select dm;Run;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;29. How did you do data cleaning? How do you change the values in the data on your own?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;I used proc freq and proc univariate to find the discrepancies in the data, which I reported to my manager.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;30. Definitions? &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;CDISC- Clinical data interchange standards consortium.They have different data models, which define clinical data standards for pharmaceutical industry.&lt;br /&gt;SDTM – It defines the data tabulation datasets that are to be sent to the FDA for regulatory submissions.&lt;br /&gt;(CRT’s)ADaM – (Analysis data Model)Defines data set definition guidance for creating analysis data sets.&lt;br /&gt;ODM – XML – based data model for allows transfer of XML based data .&lt;br /&gt;Define.xml – for data definition file (define.pdf) which is machine readable.&lt;br /&gt;ICH E3: Guideline, Structure and Content of Clinical Study Reports&lt;br /&gt;ICH E6: Guideline, Good Clinical Practice&lt;br /&gt;ICH E9: Guideline, Statistical Principles for Clinical Trials&lt;br /&gt;Title 21 Part 312.32: Investigational New Drug Application.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;31. have you ever done any Edit check programs in your project, if you have, tell me what do you know about edit check programs?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Yes I have done edit check programs .Edit check programs – Data validation.&lt;br /&gt;1.Data Validation – proc means, proc univariate, proc freq.Data Cleaning – finding errors.&lt;br /&gt;2.Checking for invalid character values.&lt;br /&gt;Proc freq data = patients;&lt;br /&gt;Tables gender dx ae / nocum nopercent;&lt;br /&gt;Run;&lt;br /&gt;Which gives frequency counts of unique character values.&lt;br /&gt;&lt;br /&gt;3. Proc print with where statement to list invalid data values.&lt;br /&gt;[systolic blood pressure - 80 to 100]&lt;br /&gt;[diastolic blood pressure – 60 to 120]&lt;br /&gt;&lt;br /&gt;4. Proc means, univariate and tabulate to look for outliers.&lt;br /&gt;Proc means – min, max, n and mean.&lt;br /&gt;Proc univariate – five highest and lowest values[ stem leaf plots and box plots]&lt;br /&gt;&lt;br /&gt;5. PROC FORMAT – range checking&lt;br /&gt;6. Data Analysis – set, merge, update, keep, drop in data step.&lt;br /&gt;7. Create datasets – PROC IMPORT and data step from flat files.&lt;br /&gt;8. Extract data – LIBNAME.&lt;br /&gt;9. SAS/STAT – PROC ANOVA, PROC REG.&lt;br /&gt;10. Duplicate Data – PROC SORT Nodupkey or NoduplicateNodupkey – only checks for duplicates in BYNoduplicate – checks entire observation (matches all variables)For getting duplicate observations first sort BY nodupkey and merge it back to the original dataset and keep only records in original and sorted.&lt;br /&gt;&lt;br /&gt;11.For creating analysis datasets from the raw data sets I used the PROC FORMAT, and rename and length statements to make changes and finally make a analysis data set.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;32. What is Verification?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The purpose of the verification is to ensure the accuracy of the final tables and the quality of SAS programs that generated the final tables. According to the instructions SOP and the SAP I selected the subset of the final summary tables for verification. E.g Adverse event table, baseline and demographic characteristics table.The verification results were verified against with the original final tables and all discrepancies if existed were documented.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;33. What is ANNOTATED CRF?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;An annotated CRF is a CRF in which the variable names are written next to the spaces provided for the investigator. It serves as a link between the database/data sets and the questions on the CRF.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;34. What is Program Validation?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Its same as macro validation except here we have to validate the programs i.e according to the SOP I had to first determine what the program is supposed to do, see if they work as they are supposed to work and create a validation document mentioning if the program works properly and set the status as pass or fail.Pass the input parameters to the program and check the log for errors.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;35. What do you lknow about ISS and ISE, have you ever produced these reports?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;ISS (Integrated summary of safety):Integrates safety information from all sources (animal, clinical pharmacology, controlled and uncontrolled studies, epidemiologic data).&lt;br /&gt;"ISS is, in part, simply a summation of data from individual studies and, in part, a new analysis that goes beyond what can be done with individual studies.&lt;br /&gt;"ISE (Integrated Summary of efficacy)ISS &amp;amp; ISE are critical components of the safety and effectiveness submission and expected to be submitted in the application in accordance with regulation.&lt;br /&gt;FDA’s guidance Format and Content of Clinical and Statistical Sections of Application gives advice on how to construct these summaries. Note that, despite the name, these are integrated analyses of all relevant data, not summaries.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;36. Explain the process and how to do Data Validation?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;I have done data validation and data cleaning to check if the data values are correct or if they conform to the standard set of rules.A very simple approach to identifying invalid character values in this file is to use PROC FREQ to list all the unique values of these variables. This gives us the total number of invalid observations. After identifying the invalid data …we have to locate the observation so that we can report to the manager the particular patient number.&lt;br /&gt;&lt;br /&gt;Invalid data can be located using the data _null_ programming.&lt;br /&gt;Following is e.g&lt;br /&gt;DATA _NULL_;&lt;br /&gt;INFILE "C:PATIENTS,TXT" PAD;&lt;br /&gt;FILE PRINT;&lt;br /&gt;***SEND OUTPUT TO THEOUTPUT WINDOW;&lt;br /&gt;TITLE "LISTING OF INVALID DATA";&lt;br /&gt;***NOTE: WE WILL ONLY INPUT THOSEVARIABLES OF INTEREST;&lt;br /&gt;INPUT @1 PATNO $3.@4 GENDER $1.@24 DX $3.@27 AE $1.;&lt;br /&gt;***CHECK GENDER;&lt;br /&gt;IF GENDER NOT IN ('F','M',' ') THENPUT PATNO= GENDER=;&lt;br /&gt;***CHECK DX;&lt;br /&gt;IF VERIFY(DX,' 0123456789') NE 0THEN PUT PATNO= DX=;&lt;br /&gt;***CHECK AE;&lt;br /&gt;IF AE NOT IN ('0','1',' ') THEN PUTPATNO= AE=;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;For data validation of numeric values like out of range or missing values I used proc print with a where statement.&lt;br /&gt;PROC PRINT DATA=CLEAN.PATIENTS;&lt;br /&gt;WHERE HR NOT BETWEEN 40 AND 100 AND&lt;br /&gt;HR IS NOT MISSING ORSBP NOT BETWEEN 80 AND 200 AND&lt;br /&gt;SBP IS NOT MISSING ORDBP NOT BETWEEN 60 AND 120 AND&lt;br /&gt;DBP IS NOT MISSING;&lt;br /&gt;&lt;br /&gt;TITLE "OUT-OF-RANGE VALUES FOR NUMERICVARIABLES";&lt;br /&gt;ID PATNO;&lt;br /&gt;VARHR SBP DBP;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;If we have a range of numeric values ‘001’ – ‘999’ then we can&lt;br /&gt;first use user defined format and then use proc freq to determine&lt;br /&gt;the invalid values.&lt;br /&gt;PROC FORMAT;VALUE $GENDER 'F','M' = 'VALID'&lt;br /&gt;' ' = 'MISSING'&lt;br /&gt;OTHER = 'MISCODED';&lt;br /&gt;VALUE $DX '001' - '999'= 'VALID'&lt;br /&gt;' ' = 'MISSING'OTHER = 'MISCODED';&lt;br /&gt;VALUE $AE '0','1' = 'VALID'&lt;br /&gt;' ' = 'MISSING'&lt;br /&gt;OTHER = 'MISCODED';&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;One of the simplest ways to check for invalid numeric values is to run either PROC MEANS or PROC UNIVARIATE.&lt;br /&gt;We can use the N and NMISS options in the Proc Means to check for missing and invalid data. Default (n nmiss mean min max stddev).&lt;br /&gt;&lt;br /&gt;The main advantage of using PROC UNIVARIATE (default n mean std skewness kurtosis) is that we get the extreme values i.e lowest and highest 5 values which we can see for data errors. If u want to see the patid for these particular observations …..state and ID patno statement in the univariate procedure.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;37. Roles and responsibilities?&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;Programmer: Develop programming for report formats (ISS &amp;amp; ISE shell) required by the regulatory authorities.Update ISS/ISE shell, when required.&lt;br /&gt;Clinical Study Team: Provide information on safety and efficacy findings, when required.Provide updates on safety and efficacy findings for periodic reporting.Study StatisticianDraft ISS and ISE shell.Update shell, when appropriate.Analyze and report data in approved format, to meet periodic reporting requirements.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;38. Explain Types of Clinical trials study you come across?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Single Blind StudyWhen the patients are not aware of which treatment they receive&lt;br /&gt;Double Blind StudyWhen the patients and the investigator are unaware of the treatment group assigned&lt;br /&gt;Triple Blind StudyTriple blind study is when patients, investigator, and the project team are unaware of the treatments administered.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;39. What are the domains/datasets you have used in your studies?&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;Demog&lt;br /&gt;Adverse Events&lt;br /&gt;Vitals&lt;br /&gt;ECG&lt;br /&gt;Labs&lt;br /&gt;Medical History&lt;br /&gt;PhysicalExam&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;40. Can you list the variables in all the domains?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Demog&lt;/strong&gt;: Patient Id, Age, Sex, Race, Screening Weight, Screening Height, BMI&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Adverse Events&lt;/strong&gt;: Protocol no, Investigator no, Patient Id, Preferred Term, Investigator Term, (Abdominal dis, Freq urination, headache, dizziness, hand-food syndrome, rash, Leukopenia, Neutropenia) Severity, Seriousness (y/n), Seriousness Type (death, life threatening, permanently disabling), Visit number, Start time, Stop time, Related to study drug?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Vitals:&lt;/strong&gt; Subject number, Study date, Procedure time, Sitting blood pressure, Sitting Cardiac Rate, Visit number, Change from baseline, Dose of treatment at time of vital sign, Abnormal (yes/no), BMI, Systolic blood pressure, Diastolic blood pressure.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ECG:&lt;/strong&gt; Subject no, Study Date, Study Time, Visit no, PR interval (msec), QRS duration (msec), QT interval (msec), QTc interval (msec), Ventricular Rate (bpm), Change from baseline, Abnormal.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Labs:&lt;/strong&gt; Subject no, Study day, Lab parameter (Lparm), lab units, ULN (upper limit of normal), LLN (lower limit of normal), visit number, change from baseline, Greater than ULN (yes/no), lab related serious adverse event (yes/no).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Medical History&lt;/strong&gt;: Medical Condition, Date of Diagnosis (yes/no), Years of onset or occurrence, Past condition (yes/no), Current condition (yes/no).PhysicalExam: Subject no, Exam date, Exam time, Visit number, Reason for exam, Body system, Abnormal (yes/no), Findings, Change from baseline (improvement, worsening, no change), Comments.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;41. Give me the example of edit ckecks you made in your programs?&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;Examples of Edit Checks&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Demog:&lt;/strong&gt;&lt;br /&gt;Weight is outside expected range&lt;br /&gt;Body mass index is below expected ( check weight and height)&lt;br /&gt;Age is not within expected range&lt;br /&gt;DOB is greater than the Visit date&lt;br /&gt;InvalidGender value&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Adverse&lt;br /&gt;&lt;/strong&gt;Stop is before the start or visit&lt;br /&gt;Start is before birthdate&lt;br /&gt;Study medicine discontinued due to adverse event but completion indicated (COMPLETE =1)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Labs&lt;br /&gt;&lt;/strong&gt;Result is within the normal range but abnormal is not blank or ‘N’&lt;br /&gt;Result is outside the normal range but abnormal is blank&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Vitals&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Diastolic BP &gt; Systolic BP&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Medical History&lt;br /&gt;&lt;/strong&gt;Visit date prior to Screen date&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Physical&lt;br /&gt;&lt;/strong&gt;Physical exam is normal but comment included&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;42. What are the advantages of using SAS in clinical data management? Why should not we use other software products in managing clinical data?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;ADVANTAGES OF USING A SAS®-BASED SYSTEM&lt;/strong&gt;&lt;br /&gt;Less hardware is required. A Typical SAS®-based system can utilize a standard file server to store its databases and does not require one or more dedicated servers to handle the application load. PC SAS® can easily be used to handle processing, while data access is left to the file server. Additionally, as presented later in this paper, it is possible to use the SAS® product SAS®/Share to provide a dedicated server to handle data transactions.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Fewer personnel are required.&lt;br /&gt;&lt;/strong&gt;Systems that use complicated database software often require the hiring of one ore more DBA’s (Database Administrators) who make sure the database software is running, make changes to the structure of the database, etc. These individuals often require special training or background experience in the particular database application being used, typically Oracle. Additionally, consultants are often required to set up the system and/or studies since dedicated servers and specific expertise requirements often complicate the process.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Users with even casual SAS® experience can set up studies.&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;Novice programmers can build the structure of the database and design screens. Organizations that are involved in data management almost always have at least one SAS® programmer already on staff. SAS® programmers will have an understanding of how the system actually works which would allow them to extend the functionality of the system by directly accessing SAS® data from outside of the system.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Speed of setup is dramatically reduced.&lt;/strong&gt;&lt;br /&gt;By keeping studies on a local file server and making the database and screen design processes extremely simple and intuitive, setup time is reduced from weeks to days.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;All phases of the data management process become homogeneous. &lt;/strong&gt;&lt;br /&gt;From entry to analysis, data reside in SAS® data sets, often the end goal of every data management group. Additionally, SAS® users are involved in each step, instead of having specialists from different areas hand off pieces of studies during the project life cycle.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;No data conversion is required.&lt;/strong&gt;&lt;br /&gt;Since the data reside in SAS® data sets natively, no conversion programs need to be written.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Data review can happen during the data entry process, on the master database. &lt;/strong&gt;&lt;br /&gt;As long as records are marked as being double-keyed, data review personnel can run edit check programs and build queries on some patients while others are still being entered.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Tables and listings can be generated on live data. &lt;/strong&gt;&lt;br /&gt;This helps speed up the development of table and listing programs and allows programmers to avoid having to make continual copies or extracts of the data during testing.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;43. Have you ever had to follow SOPs or programming guidelines?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SOP describes the process to assure that standard coding activities, which produce tables, listings and graphs, functions and/or edit checks, are conducted in accordance with industry standards are appropriately documented.It is normally used whenever new programs are required or existing programs required some modification during the set-up, conduct, and/or reporting clinical trial data.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;44. Describe the types of SAS programming tasks that you performed: Tables? Listings? Graphics? Ad hoc reports? Other?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Prepared programs required for the ISS and ISE analysis reports. Developed and validated programs for preparing ad-hoc statistical reports for the preparation of clinical study report. Wrote analysis programs in line with the specifications defined by the study statistician.&lt;br /&gt;Base SAS (MEANS, FREQ, SUMMARY, TABULATE, REPORT etc) and SAS/STAT procedures (REG, GLM, ANOVA, and UNIVARIATE etc.) were used for summarization, Cross-Tabulations and statistical analysis purposes.&lt;br /&gt;Created Statistical reports using Proc Report, Data _null_ and SAS Macro. Created, derived and merged and pooled datasets,listings and summary tables for Phase-I and Phase-II of clinical trials.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;45. Have you been involved in editing the data or writing data queries?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If your interviewer asks this question, the u should ask him what he means by editing the data… and data queries…&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;46. Are you involved in writing the inferential analysis plan? Table’s specifications? 47. What do you feel about hardcoding?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Programmers sometime hardcode when they need to produce report in urgent. But it is always better to avoid hardcoding, as it overrides the database controls in clinical data management. Data often change in a trial over time, and the hardcode that is written today may not be valid in the future.Unfortunately, a hardcode may be forgotten and left in the SAS program, and that can lead to an incorrect database change.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;48. How do you write a test plan?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Before writing "Test plan" you have to look into on "Functional specifications". Functional specifications itself depends on "Requirements", so one should have clear understanding of requirements and functional specifications to write a test plan.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;49. What is the difference between verification and validation?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Although the verification and validation are close in meaning, "verification" has more of a sense of testing the truth or accuracy of a statement by examining evidence or conducting experiments, while "validate" has more of a sense of declaring a statement to be true and marking it with an indication of official sanction.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;50.What other SAS features do you use for error trapping and data validation?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Conditional statements, if then else.Put statementDebug option.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;51. What is PROC CDISC?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;It is new SAS procedure that is available as a hotfix for SAS 8.2 version and comes as a part withSAS 9.1.3 version. PROC CDISC is a procedure that allows us to import (and export XML files that are compliant with the CDISC ODM version 1.2 schema. For more details refer SAS programming in the Pharmaceutical Industry text book.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;52) What is LOCF?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Pharmaceutical companies conduct longitudinalstudies on human subjects that often span several months. It is unrealistic to expect patients to keep every scheduled visit over such a long period of time.Despite every effort, patient data are not collected for some time points. Eventually, these become missing values in a SAS data set later.&lt;br /&gt;&lt;br /&gt;For reporting purposes,the most recent previously available value is substituted for each missing visit. This is called the Last Observation Carried Forward (LOCF).LOCF doesn't mean last SAS dataset observation carried forward. It means last non-missing value carried forward.&lt;br /&gt;&lt;br /&gt;It is the values of individual measures that are the "observations" in this case. And if you have multiple variables containing these values then they will be carried forward independently.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-8685409738442407951?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/8685409738442407951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=8685409738442407951' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/8685409738442407951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/8685409738442407951'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2008/01/sas-clinical-questions.html' title='SAS Clinical Questions'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-4534972120836164075</id><published>2008-01-07T23:07:00.000-08:00</published><updated>2008-01-07T23:10:49.919-08:00</updated><title type='text'>what is Retain statement</title><content type='html'>It retains the value of a variable between successive iterations of the DATA step. Usually, when the next data step iteration occurs the values in the Program Data Vector is re-initialized (set to missing), the retain statement stops this from occurring for one or more variables.&lt;br /&gt; data test;&lt;br /&gt; length var $1;&lt;br /&gt;retain var;&lt;br /&gt;prev = var; * copy value of var to prev;&lt;br /&gt;input var $; * get next value for var;&lt;br /&gt;datalines;&lt;br /&gt; a&lt;br /&gt; b&lt;br /&gt; c&lt;br /&gt;d&lt;br /&gt;e&lt;br /&gt; ;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;NOTE:well, it has many purposes depending on what you are doing. One of the most importatnt thing about retain statement is that it allows you to keep values of variables from iteration to iteration in SAS data step.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-4534972120836164075?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/4534972120836164075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=4534972120836164075' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/4534972120836164075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/4534972120836164075'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2008/01/what-is-retain-statement.html' title='what is Retain statement'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-7985730111868018327</id><published>2007-12-28T21:15:00.000-08:00</published><updated>2007-12-28T21:18:33.356-08:00</updated><title type='text'>Program on plots</title><content type='html'>data phos1;&lt;br /&gt;input sbnum pre1-pre5 post1-post5;&lt;br /&gt; diff1=post1-pre1;&lt;br /&gt;diff2=post2-pre2;&lt;br /&gt; diff3=post3-pre3;&lt;br /&gt; diff4=post4-pre4;&lt;br /&gt;diff5=post5-pre5;&lt;br /&gt;&lt;br /&gt; cards;&lt;br /&gt;10 5 2 3 4 3 4 3 4 3 2&lt;br /&gt; 11 3 5 3 2 4 5 4 5 4 3&lt;br /&gt; 12 5 4 5 3 4 5 3 4 3 4&lt;br /&gt; 13 3 5 3 2 4 5 4 5 4 3&lt;br /&gt; 14 3 5 3 2 4 5 4 5 4 3&lt;br /&gt;15 3 5 3 2 4 5 4 5 4 3&lt;br /&gt; 16 3 5 3 2 4 5 4 5 4 3&lt;br /&gt; ;&lt;br /&gt;&lt;br /&gt;goptions reset=all dev=win nodisplay gsfmode=replace hsize=4.5in vsize=3.5in ftext=swissb;&lt;br /&gt;symbol1 v=dot i=join c=black;&lt;br /&gt;symbol2 v=circle i=join c=black;&lt;br /&gt; symbol3 v=diamond i=join c=black;&lt;br /&gt; symbol4 v=star i=join c=black;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;axis1 label=(a=90 h=1 'Difference 1') minor=(n=3);&lt;br /&gt;axis2 label=(a=90 h=1 'Difference 2') minor=(n=3);&lt;br /&gt;axis3 label=(a=90 h=1 'Difference 3') minor=(n=3);&lt;br /&gt; axis4 label=(a=90 h=1 'Difference 4') minor=(n=3);&lt;br /&gt;axis5 label=('Subject' h=1) minor=none;&lt;br /&gt;&lt;br /&gt;title h=.5 ' '; **This creates a small border at top of graphs;&lt;br /&gt;&lt;br /&gt; proc gplot gout=gseg ;&lt;br /&gt;plot diff1*sbnum / name='graph1' vaxis=axis1 axis=axis5;&lt;br /&gt;plot diff2*sbnum / name='graph2' vaxis=axis2 axis=axis5;&lt;br /&gt; plot diff3*sbnum / name='graph3' vaxis=axis3 axis=axis5;&lt;br /&gt; plot diff4*sbnum / name='graph4' vaxis=axis4 axis=axis5;&lt;br /&gt;run;&lt;br /&gt;quit;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-7985730111868018327?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/7985730111868018327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=7985730111868018327' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/7985730111868018327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/7985730111868018327'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/program-on-plots.html' title='Program on plots'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-4665348807698609807</id><published>2007-12-27T04:14:00.000-08:00</published><updated>2007-12-27T04:20:14.168-08:00</updated><title type='text'>Program on DO UNTIL</title><content type='html'>Data one;&lt;br /&gt; input lastname: $15. typeofcar: $15. mileage;&lt;br /&gt;datalines;&lt;br /&gt;Jones Toyota 7435&lt;br /&gt;Smith Toyota 13001&lt;br /&gt;Jones2 Ford 3433&lt;br /&gt;Smith2 Toyota 15032&lt;br /&gt;Shepherd Nissan 4300&lt;br /&gt;Shepherd2 Honda 5582&lt;br /&gt;Williams Ford 10532&lt;br /&gt;;&lt;br /&gt;Data two; &lt;br /&gt;input startrange endrange typeofservice &amp;amp; $35.;&lt;br /&gt;datalines;&lt;br /&gt;3000 5000 oil change&lt;br /&gt;5001 6000 overdue oil change&lt;br /&gt;6001 8000 oil change and tire rotation&lt;br /&gt;8001 9000 overdue oil change&lt;br /&gt;9001 11000 oil change&lt;br /&gt;11001 12000 overdue oil change&lt;br /&gt;12001 14000 oil change and tire rotation&lt;br /&gt;14001 14999 overdue oil change&lt;br /&gt;15000 15999 15000 mile check&lt;br /&gt;;&lt;br /&gt;data combine;&lt;br /&gt; set one;&lt;br /&gt; found=0;&lt;br /&gt; do i=1 to nobs until (found); &lt;br /&gt;   set two point=i nobs=nobs; &lt;br /&gt;   if startrange &lt;= mileage &lt;= endrange then do;  &lt;br /&gt;     output;&lt;br /&gt;  found=1;&lt;br /&gt;    end; &lt;br /&gt;end;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt; proc print;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-4665348807698609807?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/4665348807698609807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=4665348807698609807' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/4665348807698609807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/4665348807698609807'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/program-on-do-until.html' title='Program on DO UNTIL'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-1801250102018832089</id><published>2007-12-27T04:12:00.000-08:00</published><updated>2007-12-27T04:14:35.078-08:00</updated><title type='text'>program on DO WHILE</title><content type='html'>data one;  drop i; &lt;br /&gt;input v1-v4;  array v(4);&lt;br /&gt;  count=0;&lt;br /&gt; do i=1 to 4 while (v{i}=1);  &lt;br /&gt; count +1;&lt;br /&gt; end;&lt;br /&gt;&lt;br /&gt;datalines;&lt;br /&gt;1 1 0 1&lt;br /&gt;1 1 1 0&lt;br /&gt;1 0 1 1&lt;br /&gt;0 1 0 0&lt;br /&gt;;&lt;br /&gt;&lt;br /&gt;proc print;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-1801250102018832089?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/1801250102018832089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=1801250102018832089' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1801250102018832089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1801250102018832089'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/program-on-do-while.html' title='program on DO WHILE'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-1442631732788738699</id><published>2007-12-27T04:10:00.000-08:00</published><updated>2007-12-27T04:12:04.866-08:00</updated><title type='text'>Using _TEMPORARY_ arrays</title><content type='html'>data test; &lt;br /&gt;input var1 var2 var3;&lt;br /&gt;datalines;      &lt;br /&gt;10 20 30&lt;br /&gt;100 . 300&lt;br /&gt;. 40 400&lt;br /&gt;;&lt;br /&gt;data new (drop=i); &lt;br /&gt;set test; &lt;br /&gt;array newval(3)_TEMPORARY_ (.1 .2 .3) ;&lt;br /&gt; array now(3) var1 var2 var3; &lt;br /&gt;do i=1 to 3;&lt;br /&gt;   if now(i)=. then now(i)=newval(i);&lt;br /&gt;  end;run;&lt;br /&gt;proc print;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-1442631732788738699?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/1442631732788738699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=1442631732788738699' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1442631732788738699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1442631732788738699'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/using-temporary-arrays.html' title='Using _TEMPORARY_ arrays'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-1704082135876874961</id><published>2007-12-27T04:08:00.000-08:00</published><updated>2007-12-27T04:10:02.197-08:00</updated><title type='text'>Create multiple observations from a single observation using multidimensional arrays</title><content type='html'>Data frame; &lt;br /&gt;Input men1 men2 men3 men4 men5 woman1 woman2 woman3 woman4 woman5;&lt;br /&gt;datalines;&lt;br /&gt;1 2 3 4 5 6 7 8 9 10&lt;br /&gt;2 3 4 5 6 7 8 9 10 11&lt;br /&gt;3 4 5 6 7 8 9 10 11 12&lt;br /&gt;;&lt;br /&gt;data restructured (drop=men1--j); &lt;br /&gt;set frame; &lt;br /&gt;Array SexRegion [2,5] men1--woman5;&lt;br /&gt;  do i=1 to 2;   &lt;br /&gt;do j=1 to 5;   &lt;br /&gt;  if i=1 then sex='M';  &lt;br /&gt;   else sex='F';  &lt;br /&gt;   region=j;  &lt;br /&gt;   size=SexRegion[i,j]; &lt;br /&gt;    output;&lt;br /&gt;   end;&lt;br /&gt; end;&lt;br /&gt;run;&lt;br /&gt;proc print;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-1704082135876874961?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/1704082135876874961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=1704082135876874961' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1704082135876874961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1704082135876874961'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/create-multiple-observations-from_27.html' title='Create multiple observations from a single observation using multidimensional arrays'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-4522844571176344553</id><published>2007-12-27T04:06:00.000-08:00</published><updated>2007-12-27T04:08:14.849-08:00</updated><title type='text'>Program on Double Trailing @</title><content type='html'>Creating Several Observations from OneLine of Data:&lt;br /&gt;&lt;br /&gt;DATA DOUBLE;&lt;br /&gt;INPUT X Y @@;&lt;br /&gt;DATALINES;&lt;br /&gt;1 2 3 4 5 6&lt;br /&gt;7 8&lt;br /&gt;;&lt;br /&gt;PROC PRINT DATA=DOUBLE;&lt;br /&gt;TITLE 'DOUBLE TRAILING @';&lt;br /&gt;RUN;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-4522844571176344553?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/4522844571176344553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=4522844571176344553' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/4522844571176344553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/4522844571176344553'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/program-on-double-trailing.html' title='Program on Double Trailing @'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-3528581460848937120</id><published>2007-12-27T04:04:00.000-08:00</published><updated>2007-12-27T04:06:30.053-08:00</updated><title type='text'>Program on Single trailing</title><content type='html'>DATA TRAILING;&lt;br /&gt;INPUT @6 TYPE $1. @;&lt;br /&gt;IF TYPE = '1' THEN INPUT AGE 1-2;&lt;br /&gt;ELSE IF TYPE = '2' THEN&lt;br /&gt;INPUT AGE 3-4;&lt;br /&gt;DROP TYPE;&lt;br /&gt;DATALINES;&lt;br /&gt;23 1&lt;br /&gt;44 2&lt;br /&gt;;&lt;br /&gt;PROC PRINT DATA=TRAILING;&lt;br /&gt;TITLE 'SINGLE TRAILING @';&lt;br /&gt;RUN;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-3528581460848937120?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/3528581460848937120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=3528581460848937120' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/3528581460848937120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/3528581460848937120'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/program-on-single-trailing.html' title='Program on Single trailing'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-296185306008444624</id><published>2007-12-27T04:02:00.000-08:00</published><updated>2007-12-27T04:03:25.413-08:00</updated><title type='text'>Program on MISSOVER</title><content type='html'>data weather; &lt;br /&gt; infile datalines missover;&lt;br /&gt;   input temp1-temp5;&lt;br /&gt;  datalines;&lt;br /&gt;97.9 98.1 98.398.6 99.2 99.1 98.5 97.5&lt;br /&gt;96.2 97.3 98.3 97.6 96.5&lt;br /&gt;;&lt;br /&gt;Run;&lt;br /&gt;Proc print data=weather;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-296185306008444624?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/296185306008444624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=296185306008444624' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/296185306008444624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/296185306008444624'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/program-on-missover.html' title='Program on MISSOVER'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-8089161582651763302</id><published>2007-12-27T03:55:00.000-08:00</published><updated>2007-12-27T04:00:49.641-08:00</updated><title type='text'>Program to generate the maximum number of consecutive missing values per observation</title><content type='html'>data mydata;&lt;br /&gt; Input id x1 x2 x3 x4 x5;&lt;br /&gt;datalines;&lt;br /&gt;1 2 . . . .&lt;br /&gt;2  2 1 2 1 .&lt;br /&gt;3 . 1 . 1 .&lt;br /&gt;4 1 . . . 1&lt;br /&gt;5 . . . 1 .&lt;br /&gt;;&lt;br /&gt;data mydata2;&lt;br /&gt; set mydata; &lt;br /&gt;array test(5) x1-x5;&lt;br /&gt;  array hold(5); &lt;br /&gt;count=0; &lt;br /&gt;do i=1 to 5; &lt;br /&gt;  if test(i) =. then count+1; &lt;br /&gt;  if test(i) ne .  or i=5 then do;&lt;br /&gt;     hold(i)=count;   &lt;br /&gt;  count=0;&lt;br /&gt;   end;&lt;br /&gt; end;&lt;br /&gt;  highcnt=max(of hold1-hold5);&lt;br /&gt; drop i count;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;proc print noobs;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-8089161582651763302?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/8089161582651763302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=8089161582651763302' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/8089161582651763302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/8089161582651763302'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/program-to-generate-maximum-number-of.html' title='Program to generate the maximum number of consecutive missing values per observation'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-3443589671325127905</id><published>2007-12-27T03:53:00.000-08:00</published><updated>2007-12-27T03:55:17.418-08:00</updated><title type='text'>Program on LABELING</title><content type='html'>DATA auto ;&lt;br /&gt;  INPUT make $  mpg rep78 weight foreign ;&lt;br /&gt;&lt;br /&gt;CARDS;&lt;br /&gt;AMC     22 3 2930 0&lt;br /&gt;AMC     17 3 3350 0&lt;br /&gt;AMC     22 . 2640 0&lt;br /&gt;Audi    17 5 2830 1&lt;br /&gt;Audi    23 3 2070 1&lt;br /&gt;BMW     25 4 2650 1&lt;br /&gt;Buick   20 3 3250 0&lt;br /&gt;Buick   15 4 4080 0&lt;br /&gt;Buick   18 3 3670 0&lt;br /&gt;Buick   26 . 2230 0&lt;br /&gt;Buick   20 3 3280 0&lt;br /&gt;Buick   16 3 3880 0&lt;br /&gt;Buick   19 3 3400 0&lt;br /&gt;Cad.    14 3 4330 0&lt;br /&gt;Cad.    14 2 3900 0&lt;br /&gt;Cad.    21 3 4290 0&lt;br /&gt;Chev.   29 3 2110 0&lt;br /&gt;Chev.   16 4 3690 0&lt;br /&gt;Chev.   22 3 3180 0&lt;br /&gt;Chev.   22 2 3220 0&lt;br /&gt;Chev.   24 2 2750 0&lt;br /&gt;Chev.   19 3 3430 0&lt;br /&gt;Datsun  23 4 2370 1&lt;br /&gt;Datsun  35 5 2020 1&lt;br /&gt;Datsun  24 4 2280 1&lt;br /&gt;Datsun  21 4 2750 1&lt;br /&gt;;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;DATA auto2;&lt;br /&gt;   SET auto;&lt;br /&gt;   LABEL rep78  ="1978 Repair Record"&lt;br /&gt;          mpg    ="Miles Per Gallon"&lt;br /&gt;          foreign="Where Car Was Made";&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;PROC CONTENTS DATA=auto2;&lt;br /&gt;RUN;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-3443589671325127905?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/3443589671325127905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=3443589671325127905' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/3443589671325127905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/3443589671325127905'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/program-on-labeling_27.html' title='Program on LABELING'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-7300063685247836222</id><published>2007-12-26T05:07:00.000-08:00</published><updated>2007-12-26T05:11:45.077-08:00</updated><title type='text'>How to increment dates in SAS?</title><content type='html'>The intnx function increments dates by intervals.  It computes the date (or datetime) of the start of each interval.  For example, let's suppose that you had a column of days of the month, and you wanted to create a new variable that was the first of the next month.  You could use the intnx function to help you create your new variable. &lt;br /&gt;&lt;br /&gt;The syntax of the intnx function is:  intnx(interval, from, n &lt;, alignment&gt;), where interval is a character (e.g., string) constant or variable, from is the starting value (either a date or datetime), n is the number of intervals to increment, and alignment is optional and controls the alignment of the dates.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#333333;"&gt;&lt;strong&gt;data temp2;&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;input id 1 @3 date mmddyy11.;&lt;br /&gt;cards;&lt;br /&gt;1 11/12/1980&lt;br /&gt;2 10/20/1996&lt;br /&gt;3 12/21/1999&lt;br /&gt;;&lt;br /&gt;run;&lt;br /&gt;proc print data = temp2;&lt;br /&gt;format date date9.;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;id date&lt;br /&gt;1 12NOV1980&lt;br /&gt;2 20OCT1996&lt;br /&gt;3 21DEC1999&lt;br /&gt;&lt;br /&gt;data temp3;&lt;br /&gt;set temp2;&lt;br /&gt;new_month = intnx('month',date,1);&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;proc print data = temp3 noobs;&lt;br /&gt;format date new_month date9.;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt; id       date        new_month&lt;br /&gt;1 12NOV1980 01DEC1980&lt;br /&gt;2 20OCT1996 01NOV1996&lt;br /&gt;3 21DEC1999 01JAN2000&lt;br /&gt;&lt;br /&gt;Now let's try another example, this time creating a variable that is two days later than the day given in our data set.&lt;br /&gt;&lt;br /&gt;data temp3a;&lt;br /&gt;set temp2;&lt;br /&gt;two_days = intnx('day',date,2);&lt;br /&gt;run;&lt;br /&gt;proc print data = temp3a noobs;&lt;br /&gt;format date two_days date9.;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;id     date           two_days&lt;br /&gt;1 12NOV1980 14NOV1980&lt;br /&gt;2 20OCT1996 22OCT1996&lt;br /&gt;3 21DEC1999 23DEC1999&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-7300063685247836222?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/7300063685247836222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=7300063685247836222' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/7300063685247836222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/7300063685247836222'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/how-to-increment-dates-in-sas.html' title='How to increment dates in SAS?'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-1041615702653928513</id><published>2007-12-26T04:45:00.000-08:00</published><updated>2007-12-26T04:53:15.400-08:00</updated><title type='text'>How to read/write Excel files in SAS?</title><content type='html'>&lt;strong&gt;Reading an Excel file into SAS&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Suppose that you have an Excel spreadsheet called auto.xls. The data for this spreadsheet are shown below.&lt;br /&gt;&lt;br /&gt;MAKE MPG WEIGHT PRICE&lt;br /&gt;AMC Concord 22 2930 4099&lt;br /&gt;AMC Pacer 17 3350 4749&lt;br /&gt;AMC Spirit 22 2640 3799&lt;br /&gt;Buick Century 20 3250 4816&lt;br /&gt;Buick Electra 15 4080 7827&lt;br /&gt;&lt;br /&gt;Using the Import Wizard is an easy way to import data into SAS.  The Import Wizard can be found on the drop down file menu.  Although the Import Wizard is easy it can be time consuming if used repeatedly.  The very last screen of the Import Wizard gives you the option to save the statements SAS uses to import the data so that it can be used again.  The following is an example that uses common options and also shows that the file was imported correctly.&lt;br /&gt;&lt;br /&gt;PROC IMPORT OUT= WORK.auto1&lt;br /&gt;DATAFILE= "C:\auto.xls"&lt;br /&gt;DBMS=EXCEL REPLACE;&lt;br /&gt;SHEET="auto1";&lt;br /&gt;GETNAMES=YES;&lt;br /&gt;MIXED=YES;&lt;br /&gt;USEDATE=YES;&lt;br /&gt;SCANTIME=YES;&lt;br /&gt;RUN;&lt;br /&gt;proc print data=auto1;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;Obs MAKE MPG WEIGHT PRICE&lt;br /&gt;1 AMC Concord 22 2930 4099&lt;br /&gt;2 AMC Pacer 17 3350 4749&lt;br /&gt;3 Amc Spirit 22 2640 3799&lt;br /&gt;4 Buick Century 20 3250 4816&lt;br /&gt;5 Buick Electra 15 4080 7827&lt;br /&gt;&lt;br /&gt;First we use the out= statement to tell SAS where to store the date once its imported. &lt;br /&gt;Next the datafile= statement tells SAS where to find the file we want to import. &lt;br /&gt;&lt;br /&gt;The dbms= statement is used to identify the type of file being imported.&lt;br /&gt;&lt;br /&gt; This statement is redundant if the file you want to import already has an appropriate file extension, for example *.xls. &lt;br /&gt;&lt;br /&gt;The replace statement will overwrite an existing file.&lt;br /&gt;&lt;br /&gt;To specify which sheet SAS should import use the sheet="sheetname" statement.  The default is for SAS to read the first sheet.  Note that sheet names can only be 31 characters long.&lt;br /&gt;&lt;br /&gt;The getnames=yes is the default setting and SAS will automatically use the first row of data as variable names.  If the first row of your sheet does not contain variable names use the getnames=no. &lt;br /&gt;&lt;br /&gt;SAS uses the first eight rows of data to determine whether the variable should be read as character or numeric.  The default setting mixed=no assumes that each variable is either all character or all numeric.  If  you have a variable with both character and numeric values or a variable with missing values use mixed=yes statement to be sure SAS will read it correctly. &lt;br /&gt;Conveniently SAS reads date, time and datetime formats.  The usedate=yes is the default statement and SAS will read date or time formatted data as a date.  When usedate=no SAS will read date and time formatted data with a datetime format.  Keep the default statement scantime=yes to read in time formatted data as long as the variable does not also contain a date format.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example 1: Making a permanent data file&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;What if you want the SAS data set created from proc import to be permanent? The answer is to use libname statement. Let's say that we have an Excel file called auto.xls in directory "d:\temp" and we want to convert it into a SAS data file (call it myauto) and put it into the directory "c:\dissertation". Here is what we can do.&lt;br /&gt;libname dis "c:\dissertation";&lt;br /&gt;proc import datafile="d:\temp\auto.xls" out=dis.myauto replace;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example 2: Reading in a specific sheet&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Sometimes you may only want to read a particular sheet from an Excel file instead of the entire Excel file. Let's say that we have a two-sheet Excel file called auto2.xls. The example below shows how to use the option sheet=sheetname to read the second sheet called page2 in it.&lt;br /&gt;proc import datafile="auto2.xls" out=auto1 replace;&lt;br /&gt;sheet="page2";&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example 3: Reading a file without variable names&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;What if the variables in your Excel file do not have variable names? The answer here is to use the statement getnames=no in proc import. Here is an example showing how to do this.&lt;br /&gt;&lt;br /&gt;proc import datafile="a:\faq\auto.xls" out=auto replace;&lt;br /&gt;getnames=no;&lt;br /&gt;run;&lt;br /&gt;Writing Excel files out from SAS&lt;br /&gt;It is very easy to write out an Excel file using proc export in SAS version 8. Consider the following sample data file below.&lt;br /&gt;&lt;br /&gt;Obs MAKE MPG WEIGHT PRICE&lt;br /&gt;&lt;br /&gt;1 AMC 22 2930 4099&lt;br /&gt;2 AMC 17 3350 4749&lt;br /&gt;3 AMC 22 2640 3799&lt;br /&gt;4 Buick 20 3250 4816&lt;br /&gt;5 Buick 15 4080 7827&lt;br /&gt;&lt;br /&gt;Here is a sample program that writes out an Excel file called mydata.xls into the directory "c:\dissertation".&lt;br /&gt;&lt;br /&gt;proc export data=mydata outfile='c:\dissertation\mydata.xls' replace;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-1041615702653928513?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/1041615702653928513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=1041615702653928513' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1041615702653928513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1041615702653928513'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/how-to-readwrite-excel-files-in-sas.html' title='How to read/write Excel files in SAS?'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-7558974987821522906</id><published>2007-12-26T04:43:00.000-08:00</published><updated>2007-12-26T04:45:24.839-08:00</updated><title type='text'>What are some common options for the infile statement in SAS?</title><content type='html'>There are a large number of options that you can use on the infile statement. This is a brief summary of commonly used options. You can determine which options you may need by examining your raw data file e.g., in Notepad, Wordpad, using more (on UNIX) or any other command that allows you to view your data.&lt;br /&gt;&lt;br /&gt;Let's start with a simple example reading the space delimited file shown below.&lt;br /&gt;&lt;br /&gt;22 2930 4099&lt;br /&gt;17 3350 4749&lt;br /&gt;22 2640 3799&lt;br /&gt;20 3250 4816&lt;br /&gt;15 4080 7827&lt;br /&gt;&lt;br /&gt;The example program shows how to read the space delimited file shown above.&lt;br /&gt;&lt;br /&gt;DATA cars;&lt;br /&gt;INFILE 'space1.txt' ;&lt;br /&gt;INPUT mpg weight price;&lt;br /&gt;RUN;&lt;br /&gt;PROC PRINT DATA=cars;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;As you can see in the output below, the data was read properly. OBS MPG WEIGHT PRICE&lt;br /&gt;&lt;br /&gt;1 22 2930 4099&lt;br /&gt;2 17 3350 4749&lt;br /&gt;3 22 2640 3799&lt;br /&gt;4 20 3250 4816&lt;br /&gt;5 15 4080 7827&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Infile options&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;For more complicated file layouts, refer to the infile options described below.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;DLM&lt;/strong&gt;=The dlm= option can be used to specify the delimiter that separates the variables in your raw data file. For example, dlm=','indicates a comma is the delimiter (e.g., a comma separated file, .csv file). Or, dlm='09'x indicates that tabs are used to separate your variables (e.g., a tab separated file).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;DSD &lt;/strong&gt;The dsd option has 2 functions. First, it recognizes two consecutive delimiters as a missing value. For example, if your file contained the line 20,30,,50 SAS will treat this as 20 30 50 but with the the dsd option SAS will treat it as 20 30 . 50 , which is probably what you intended. Second, it allows you to include the delimiter within quoted strongs. For example, you would want to use the dsd option if you had a comma separated file and your data included values like "George Bush, Jr.". With the dsd option, SAS will recognize that the comma in "George Bush, Jr." is part of the name, and not a separator indicating a new variable.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FIRSTOBS&lt;/strong&gt;=This option tells SAS what on what line you want it to start reading your raw data file. If the first record(s) contains header information such as variable names, then set firstobs=n where n is the record number where the data actually begin. For example, if you are reading a comma separated file or a tab separated file that has the variable names on the first line, then use firstobs=2 to tell SAS to begin reading at the second line (so it will ignore the first line with the names of the variables).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;MISSOVER  &lt;/strong&gt;This option prevents SAS from going to a new input line if it does not find values for all of the variables in the current line of data. For example, you may be reading a space delimited file and that is supposed to have 10 values per line, but one of the line had only 9 values. Without the missover option, SAS will look for the 10th value on the next line of data. If your data is supposed to only have one observation for each line of raw data, then this could cause errors throughout the rest of your data file. If you have a raw data file that has one record per line, this option is a prudent method of trying to keep such errors from cascading through the rest of your data file.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;OBS=&lt;/strong&gt; Indicates which line in your raw data file should be treated as the last record to be read by SAS. This is a good option to use for testing your program. For example, you might use obs=100 to just read in the first 100 lines of data while you are testing your program. When you want to read the entire file, you can remove the obs= option entirely.&lt;br /&gt;&lt;br /&gt;A typical infile statement for reading a comma delimited file that contains the variable names in the first line of data would be:&lt;br /&gt;&lt;br /&gt;INFILE "test.txt" DLM=',' DSD MISSOVER FIRSTOBS=2 ;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-7558974987821522906?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/7558974987821522906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=7558974987821522906' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/7558974987821522906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/7558974987821522906'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/what-are-some-common-options-for-infile.html' title='What are some common options for the infile statement in SAS?'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-136325176699660828</id><published>2007-12-26T04:41:00.000-08:00</published><updated>2007-12-26T04:42:47.663-08:00</updated><title type='text'>How do I read a delimited file that has embedded delimiters in the data?</title><content type='html'>Suppose you are reading a comma separated file, but your data contains commas in it. For example, say your file contains age name and weight and looks like the one below.&lt;br /&gt;&lt;br /&gt;48,'Bill Clinton',210&lt;br /&gt;50,'George Bush, Jr.',180&lt;br /&gt;&lt;br /&gt;Say you read this file as you would any other comma delimited file, like the example shown below.&lt;br /&gt;&lt;br /&gt;DATA guys1;&lt;br /&gt;length name $ 20 ;&lt;br /&gt;INFILE 'readdsd2.txt' DELIMITER=',' ;&lt;br /&gt;INPUT age name weight ;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;PROC PRINT DATA=guys1;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;But, as we see below, the data were not read as we wished. The quotes are treated as data, and George Bush lost the , Jr off his name, and his weight is missing. This is because SAS treated the , in George Bush's name as a indicating the end of the variable, which is not what we wanted.OBS NAME AGE WEIGHT&lt;br /&gt;&lt;br /&gt;1 'Bill Clinton' 48 210&lt;br /&gt;2 'George Bush 50 .&lt;br /&gt;&lt;br /&gt;Below, we use the dsd option to read the same file.&lt;br /&gt;&lt;br /&gt; DATA guys2;&lt;br /&gt;length name $ 20 ;&lt;br /&gt;INFILE 'readdsd2.txt' DELIMITER=',' DSD ;&lt;br /&gt;INPUT age name weight ;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;PROC PRINT DATA=guys2;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;As you see in the output below, SAS properly treated the quotes as delimiters, and it read in Mr. Bush's name properly and his weight properly. OBS NAME AGE WEIGHT&lt;br /&gt;&lt;br /&gt;1 Bill Clinton 48 210&lt;br /&gt;2 George Bush, Jr. 50 180&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-136325176699660828?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/136325176699660828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=136325176699660828' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/136325176699660828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/136325176699660828'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/how-do-i-read-delimited-file-that-has.html' title='How do I read a delimited file that has embedded delimiters in the data?'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-8055798441014536151</id><published>2007-12-26T04:38:00.000-08:00</published><updated>2007-12-26T04:40:35.943-08:00</updated><title type='text'>How do I read a delimited file with missing data in SAS?</title><content type='html'>It is very convenient to read comma delimited, tab delimited, or other kinds of delimited raw data files. However, you need to be very careful when reading delimited data with missing values. Consider the example raw data file below. Note that the value of mpg is missing for the AMC Pacer and the missing value is signified with two consecutive commas (,,).&lt;br /&gt;&lt;br /&gt;AMC Concord,22,2930,4099&lt;br /&gt;AMC Pacer,,3350,4749&lt;br /&gt;AMC Spirit,22,2640,3799&lt;br /&gt;Buick Century,20,3250,4816&lt;br /&gt;Buick Electra,15,4080,7827&lt;br /&gt;&lt;br /&gt;We read the file using the program below using delimiter=',' to indicate that commas are used as delimiters.&lt;br /&gt;&lt;br /&gt; DATA cars1;&lt;br /&gt;length make $ 20 ;&lt;br /&gt;INFILE 'readdsd.txt' DELIMITER=',' ;&lt;br /&gt;INPUT make mpg weight price;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;PROC PRINT DATA=cars1;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;But, as we see below, the data was read incorrectly for the AMC Pacer. OBS MAKE MPG WEIGHT PRICE&lt;br /&gt;&lt;br /&gt;1 AMC Concord 22 2930 4099&lt;br /&gt;2 AMC Pacer 3350 4749 .&lt;br /&gt;3 Buick Century 20 3250 4816&lt;br /&gt;4 Buick Electra 15 4080 7827&lt;br /&gt;&lt;br /&gt;SAS does not properly recognize empty values for delimited data unless you use the dsd option. You need to use the dsd option on the infile statement if two consecutive delimiters are used to indicate missing values (e.g., two consecutive commas, two consecutive tabs). Below, we read the exact same file again, except that we use the dsd option.&lt;br /&gt;&lt;br /&gt; DATA cars2;&lt;br /&gt;length make $ 20 ;&lt;br /&gt;INFILE 'readdsd.txt' DELIMITER=',' DSD ;&lt;br /&gt;INPUT make mpg weight price;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;PROC PRINT DATA=cars2;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;The output is shown below. OBS MAKE MPG WEIGHT PRICE&lt;br /&gt;&lt;br /&gt;1 AMC Concord 22 2930 4099&lt;br /&gt;2 AMC Pacer . 3350 4749&lt;br /&gt;3 AMC Spirit 22 2640 3799&lt;br /&gt;4 Buick Century 20 3250 4816&lt;br /&gt;5 Buick Electra 15 4080 7827&lt;br /&gt;&lt;br /&gt;As you see in the output, the data for the AMC Pacer was read correctly because we used the dsd option.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-8055798441014536151?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/8055798441014536151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=8055798441014536151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/8055798441014536151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/8055798441014536151'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/how-do-i-read-delimited-file-with.html' title='How do I read a delimited file with missing data in SAS?'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-2912442347013876840</id><published>2007-12-26T04:23:00.000-08:00</published><updated>2007-12-26T04:32:33.931-08:00</updated><title type='text'>How do I read a file that uses commas, tabs or spaces as delimiters to separate variables in SAS version 8?</title><content type='html'>Comma-separated files&lt;br /&gt;It is quite easy to read a file that uses a comma as a delimiter using proc import in SAS version 8. There are two slightly different ways of reading a comma delimited file using proc import. In SAS version 8, a comma delimited file can be considered as a special type of external file with special file extension .csv, which stands for comma-separated-variables. We show here the first sample program making use of this feature. Let's say we have following data stored in a file called comma.csv.&lt;br /&gt;AMC,22,3,2930,0,11:11&lt;br /&gt;AMC,17,3,3350,0,11:30&lt;br /&gt;AMC,22,,2640,0,12:34&lt;br /&gt;Audi,17,5,2830,1,13:20&lt;br /&gt;Audi,23,3,2070,1,11:11&lt;br /&gt;Then the following proc import statement will read it in and create a temporary data set called mydata.&lt;br /&gt;proc import datafile="comma.csv" &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('out', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;out&lt;/a&gt;=mydata &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dbms', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dbms&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('csv', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;csv&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('rep', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;replace&lt;/a&gt;;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('gname', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;getnames&lt;/a&gt;=no;&lt;br /&gt;run;&lt;br /&gt;proc print data=mydata;&lt;br /&gt;run;&lt;br /&gt;As you can see in the output below, the data was read properly. Also notice that SAS create default variable names as VAR1-VARn when variables names are not present in the raw data file.&lt;br /&gt;Obs VAR1 VAR2 VAR3 VAR4 VAR5 VAR6&lt;br /&gt;1 AMC 22 3 2930 0 11:11&lt;br /&gt;2 AMC 17 3 3350 0 11:30&lt;br /&gt;3 AMC 22 . 2640 0 12:34&lt;br /&gt;4 Audi 17 5 2830 1 13:20&lt;br /&gt;5 Audi 23 3 2070 1 11:11&lt;br /&gt;You might have a file where you have the names at the top of the file like the one below.  With such a file you would like SAS to use the variable names from the file (e.g., make mpg etc.).  &lt;br /&gt;make,mpg,rep78,weight,foreign,time&lt;br /&gt;AMC,22,3,2930,0,11:11&lt;br /&gt;AMC,17,3,3350,0,11:30&lt;br /&gt;AMC,22,,2640,0,12:34&lt;br /&gt;Audi,17,5,2830,1,13:20&lt;br /&gt;Audi,23,3,2070,1,11:11&lt;br /&gt;We can use the getnames=yes; statement to tell SAS we want it to read the variable names from the first line of the data file, as illustrated below.&lt;br /&gt;proc import datafile="comma1.csv" &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('out', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;out&lt;/a&gt;=mydata &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dbms', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dbms&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('csv', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;csv&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('rep', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;replace&lt;/a&gt;;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('gname', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;getnames&lt;/a&gt;=yes;&lt;br /&gt;run;&lt;br /&gt;proc print data=mydata;&lt;br /&gt;run;&lt;br /&gt;As you can see from the output of the proc print shown below, the data are read correctly.&lt;br /&gt;Obs make mpg rep78 weight foreign time&lt;br /&gt;1 AMC 22 3 2930 0 11:11&lt;br /&gt;2 AMC 17 3 3350 0 11:30&lt;br /&gt;3 AMC 22 . 2640 0 12:34&lt;br /&gt;4 Audi 17 5 2830 1 13:20&lt;br /&gt;5 Audi 23 3 2070 1 11:11&lt;br /&gt;Another way of reading a comma delimited file is to consider a comma as an ordinary delimiter. Here is a program that shows how to use the dbms=dlm and delimiter="," option to read a file just like we did above. Also notice that the external file doesn't have to have .csv extension.&lt;br /&gt;proc import datafile="comma1.txt" &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('out', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;out&lt;/a&gt;=mydata &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dbms', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dbms&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dlm', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dlm&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('rep', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;replace&lt;/a&gt;;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('delimiter', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;delimiter&lt;/a&gt;=",";&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('gname', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;getnames&lt;/a&gt;=yes;&lt;br /&gt;run; You may want to create a permanent SAS data file using proc import. Suppose that we want to create a permanent SAS data file called mydata in the directory "c:\dissertation". We can do the following. &lt;br /&gt;libname &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('libref', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dis&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('v8', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;v8&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('path', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;"c:\dissertation"&lt;/a&gt;;&lt;br /&gt;proc import datafile="comma1.txt" &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('out', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;out&lt;/a&gt;=dis.mydata &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dbms', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dbms&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dlm', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dlm&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('rep', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;replace&lt;/a&gt;;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('delimiter', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;delimiter&lt;/a&gt;=",";&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('gname', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;getnames&lt;/a&gt;=yes;&lt;br /&gt;run;Another feature of proc import is that you can read in the input file starting from a specific row number using datarow= statement. Let's say that we want read from observation 4 on of the text file comma1.txt. Since variables have names on the first row in the raw data file, we have to use datarow=5.&lt;br /&gt;proc import datafile="comma1.txt" &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('out', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;out&lt;/a&gt;=mydata &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dbms', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dbms&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dlm', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dlm&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('rep', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;replace&lt;/a&gt;;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('delimiter', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;delimiter&lt;/a&gt;=",";&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('gname', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;getnames&lt;/a&gt;=yes;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('drow', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;datarow&lt;/a&gt;=5;&lt;br /&gt;run;&lt;br /&gt;proc print data=mydata;&lt;br /&gt;run;Now we can see from the output below the data has been read correctly.&lt;br /&gt;Obs make mpg rep78 weight foreign time&lt;br /&gt;1 Audi 17 5 2830 1 13:20&lt;br /&gt;2 Audi 23 3 2070 1 11:11On the other hand, if our variables don't have names in the raw file, we need to use getnames=no and datarow=4 as shown below.&lt;br /&gt;proc import datafile="comma2.txt" &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('out', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;out&lt;/a&gt;=mydata &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dbms', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dbms&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dlm', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dlm&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('rep', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;replace&lt;/a&gt;;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('delimiter', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;delimiter&lt;/a&gt;=",";&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('gname', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;getnames&lt;/a&gt;=no;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('drow', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;datarow&lt;/a&gt;=4;&lt;br /&gt;run;&lt;br /&gt;Tab-delimited files&lt;br /&gt;It is quite easy to read a file that uses a tab as a delimiter using proc import in SAS version 8. There are two slightly different ways of reading a tab delimited file using proc import. In SAS version 8, a tab delimited file can be considered as a special type of external file with file extension .txt. We show here the first sample program making use of this feature. Let's say we have following data stored in a file called tab.txt.&lt;br /&gt;AMC Concrod 22 2930 4099&lt;br /&gt;AMC Pacer 17 3350 4749&lt;br /&gt;AMC Sprint 22 2640 3799&lt;br /&gt;Buick Century 22 3250 4816&lt;br /&gt;Buick Electra 15 4080 7827&lt;br /&gt;Then the following proc import statement will read it in and create a temporary data set called mydata.&lt;br /&gt;proc import datafile="tab.txt" &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('out', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;out&lt;/a&gt;=mydata &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dbms', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dbms&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('tab1', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;tab&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('rep', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;replace&lt;/a&gt;;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('gname', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;getnames&lt;/a&gt;=no;&lt;br /&gt;run;&lt;br /&gt;proc print data=mydata;&lt;br /&gt;run;&lt;br /&gt;As you can see in the output below, the data was read properly. Also notice that SAS create default variable names as VAR1-VARn when variables names are not present in the raw data file.&lt;br /&gt;Obs VAR1 VAR2 VAR3 VAR4&lt;br /&gt;1 AMC Concrod 22 2930 4099&lt;br /&gt;2 AMC Pacer 17 3350 4749&lt;br /&gt;3 AMC Sprint 22 2640 3799&lt;br /&gt;4 Buick Century 22 3250 4816&lt;br /&gt;5 Buick Electra 15 4080 7827&lt;br /&gt;You might have a file where you have the names at the top of the file like the one below.  With such a file you would like SAS to use the variable names from the file (e.g., make mpg etc.).  &lt;br /&gt;MAKE MPG WEIGHT PRICE&lt;br /&gt;AMC Concrod 22 2930 4099&lt;br /&gt;AMC Pacer 17 3350 4749&lt;br /&gt;AMC Sprint 22 2640 3799&lt;br /&gt;Buick Century 22 3250 4816&lt;br /&gt;Buick Electra 15 4080 7827&lt;br /&gt;We can use the getnames=yes; statement to tell SAS we want it to read the variable names from the first line of the data file, as illustrated below. proc import datafile="tab1.txt" &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('out', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;out&lt;/a&gt;=mydata &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dbms', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dbms&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('tab1', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;tab&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('rep', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;replace&lt;/a&gt;;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('gname', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;getnames&lt;/a&gt;=yes;&lt;br /&gt;run;&lt;br /&gt;proc print data=mydata;&lt;br /&gt;run;&lt;br /&gt;As you can see from the output of the proc print shown below, the data are read correctly.&lt;br /&gt;OBS MAKE MPG WEIGHT PRICE&lt;br /&gt;1 AMC Concord 22 2930 4099&lt;br /&gt;2 AMC Pacer 17 3350 4749&lt;br /&gt;3 AMC Spirit 22 2640 3799&lt;br /&gt;4 Buick Century 20 3250 4816&lt;br /&gt;5 Buick Electra 15 4080 7827&lt;br /&gt;Another way of reading a tab delimited file is to consider a tab as an ordinary delimiter. Here is a program that shows how to use the delimiter option to read a file just like we did above.&lt;br /&gt;proc import datafile="tab1.txt" &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('out', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;out&lt;/a&gt;=mydata &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dbms', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dbms&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dlm', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dlm&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('rep', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;replace&lt;/a&gt;;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('delimiter', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;delimiter&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('tabs1', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;'09'x&lt;/a&gt;;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('gname', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;getnames&lt;/a&gt;=yes;&lt;br /&gt;run;&lt;br /&gt;You may want to create a permanent SAS data file using proc import. Suppose that we want to create a permanent SAS data file called mydata in the directory "c:\dissertation". We can do the following. &lt;br /&gt;libname &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('libref', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dis&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('v8', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;v8&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('path', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;"c:\dissertation"&lt;/a&gt;;&lt;br /&gt;proc import datafile="tab1.txt" &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('out', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;out&lt;/a&gt;=dis.mydata &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dbms', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dbms&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dlm', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dlm&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('rep', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;replace&lt;/a&gt;;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('delimiter', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;delimiter&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('tabs1', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;'09'x&lt;/a&gt;;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('gname', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;getnames&lt;/a&gt;=yes;&lt;br /&gt;run;&lt;br /&gt;.tooltip {position: absolute;visibility: hidden;left: 0; top: 0;border-width: 1;border-color: #0000cc;border-style: solid;padding: 3;background-color: beige;}&lt;br /&gt;#out {width: 180;}&lt;br /&gt;SAS output data file&lt;br /&gt;#dbms {width: 240;}&lt;br /&gt;For specifying the type of data to import.&lt;br /&gt;#delimiter {width: 200;}&lt;br /&gt;Specify the delimiter used in the input file&lt;br /&gt;#tab1 {width: 180;}&lt;br /&gt;For a tab delimited file&lt;br /&gt;#dlm {width: 180;}&lt;br /&gt;For a delimited file&lt;br /&gt;#gname {width: 230;}&lt;br /&gt;Specify if column names exist.&lt;br /&gt;#rep {width: 260;}&lt;br /&gt;If output file already exists, PROC IMPORT will not overwrite it unless replace option is set.&lt;br /&gt;#tabs1 {width: 220;}&lt;br /&gt;'09'x is the hexidecimal value for tab.&lt;br /&gt;#dataset {width: 200;}&lt;br /&gt;The SAS data set to be written out&lt;br /&gt;#outfile {width: 180;}&lt;br /&gt;Specify the path and name for the permanent file&lt;br /&gt;#xls {width: 200;}&lt;br /&gt;PROC IMPORT knows that it is an Excel file if the file extension is .xls.&lt;br /&gt;#sheet {width: 240;}&lt;br /&gt;Specify the name of the sheet to be read in.&lt;br /&gt;#v8 {width: 220;}&lt;br /&gt;Specify to use SAS version 8 engine.&lt;br /&gt;#libref {width: 220;}&lt;br /&gt;The logical name, also known as LIBREF, associated with the directory, is assigned by user.&lt;br /&gt;#path {width: 210;}&lt;br /&gt;The physical location, i.e. the directory for the permanent data set.&lt;br /&gt;#csv {width: 200;}&lt;br /&gt;For comma-separated-variable files&lt;br /&gt;#drow {width: 220;}&lt;br /&gt;Specify the row number to start to read.&lt;br /&gt;Space-delimited files&lt;br /&gt;It is very easy to read a file that uses a space as a delimiter to separate variables using proc import in SAS version 8. Consider the following sample data file below.&lt;br /&gt;AMC 22 2930 4099&lt;br /&gt;AMC 17 3350 4749&lt;br /&gt;AMC 22 2640 3799&lt;br /&gt;Buick 20 3250 4816&lt;br /&gt;Buick 15 4080 7827&lt;br /&gt;Here is a sample program that reads the text file into SAS 8.&lt;br /&gt;proc import datafile="space.txt" &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('out', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;out&lt;/a&gt;=mydata &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dbms', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dbms&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dlm', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dlm&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('rep', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;replace&lt;/a&gt;;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('gname', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;getnames&lt;/a&gt;=no;&lt;br /&gt;run;&lt;br /&gt;Now we can use proc print to see if the data file has been read correctly into SAS 8.&lt;br /&gt;proc print data=mydata;&lt;br /&gt;run; Obs VAR1 VAR2 VAR3 VAR4&lt;br /&gt;1 AMC 22 2930 4099&lt;br /&gt;2 AMC 17 3350 4749&lt;br /&gt;3 AMC 22 2640 3799&lt;br /&gt;4 Buick 20 3250 4816&lt;br /&gt;5 Buick 15 4080 7827&lt;br /&gt;Notice that we use the getnames=no option because in the raw data file variables don't have names. SAS 8 will generate variable names as VAR1-VARn. If our raw file has names for variables on the first line as shown below, then we need to use the option getnames=yes. For example, we have following text file called space1.txt.&lt;br /&gt;MAKE MPG WEIGHT PRICE&lt;br /&gt;AMC 22 2930 4099&lt;br /&gt;AMC 17 3350 4749&lt;br /&gt;AMC 22 2640 3799&lt;br /&gt;Buick 20 3250 4816&lt;br /&gt;Buick 15 4080 7827&lt;br /&gt;Then the following program reads the file in with the variable names.&lt;br /&gt;proc import datafile="space1.txt" &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('out', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;out&lt;/a&gt;=mydata &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dbms', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dbms&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dlm', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dlm&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('rep', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;replace&lt;/a&gt;;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('gname', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;getnames&lt;/a&gt;=yes;&lt;br /&gt;run;&lt;br /&gt;What if we want to the SAS data set created above to be permanent? Let's say we want to save the permanent file in the directory "c:\dissertation". The answer is to use libname statement as shown below.&lt;br /&gt;libname &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('libref', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dis&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('v8', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;v8&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('path', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;"c:\dissertation"&lt;/a&gt;;&lt;br /&gt;proc import datafile="space1.txt" &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('out', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;out&lt;/a&gt;=dis.mydata &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dbms', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dbms&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dlm', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dlm&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('rep', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;replace&lt;/a&gt;;&lt;br /&gt;getnames=yes;&lt;br /&gt;run;&lt;br /&gt;Another feature of proc import is that you can read in the input file starting from a specific row number using datarow= statement. Let's say that  we want read from observation 3 on of the text file space1.txt. Since variables have names on the first row in the raw data file, we have to use datarow=4. &lt;br /&gt;proc import datafile="space1.txt" &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('out', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;out&lt;/a&gt;=mydata &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dbms', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dbms&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dlm', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dlm&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('rep', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;replace&lt;/a&gt;;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('gname', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;getnames&lt;/a&gt;=yes;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('drow', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;datarow&lt;/a&gt;=4;&lt;br /&gt;run;&lt;br /&gt;proc print data=mydata;&lt;br /&gt;run;&lt;br /&gt;Now we can see from the output below the data has been read correctly.&lt;br /&gt;Obs MAKE MPG WEIGHT PRICE&lt;br /&gt;1 AMC 22 2640 3799&lt;br /&gt;2 Buick 20 3250 4816&lt;br /&gt;3 Buick 15 4080 7827&lt;br /&gt;On the other hand, if our variables don't have names in the raw file, we need to use getnames=no and datarow=3 as shown below. proc import datafile="space1.txt" &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('out', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;out&lt;/a&gt;=mydata &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dbms', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dbms&lt;/a&gt;=&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('dlm', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;dlm&lt;/a&gt; &lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('rep', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;replace&lt;/a&gt;;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('gname', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;getnames&lt;/a&gt;=no;&lt;br /&gt;&lt;a class="ttip" onmouseover="if (NS4  IE4) activateEl('drow', event);" onmouseout="clearEl();" href="javascript:return(0)"&gt;datarow&lt;/a&gt;=3;&lt;br /&gt;run;&lt;br /&gt;Other kinds of delimiters&lt;br /&gt;You can use delimiter= on the infile statement to tell SAS what delimiter you are using to separate variables in your raw data file. For example, below we have a raw data file that uses exclamation points ! to separate the variables in the file.&lt;br /&gt;22!2930!4099&lt;br /&gt;17!3350!4749&lt;br /&gt;22!2640!3799&lt;br /&gt;20!3250!4816&lt;br /&gt;15!4080!7827&lt;br /&gt;The example below shows how to read this file by using delimiter='!' on the infile statement.&lt;br /&gt;DATA cars;&lt;br /&gt;INFILE 'readdel1.txt' DELIMITER='!' ;&lt;br /&gt;INPUT mpg weight price;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;PROC PRINT DATA=cars;&lt;br /&gt;RUN;&lt;br /&gt;As you can see in the output below, the data was read properly.&lt;br /&gt;OBS MPG WEIGHT PRICE&lt;br /&gt;1 22 2930 4099&lt;br /&gt;2 17 3350 4749&lt;br /&gt;3 22 2640 3799&lt;br /&gt;4 20 3250 4816&lt;br /&gt;5 15 4080 7827&lt;br /&gt;It is possible to use multiple delimiters. The example file below uses either exclamation points or plus signs as delimiters.&lt;br /&gt;22!2930!4099&lt;br /&gt;17+3350+4749&lt;br /&gt;22!2640!3799&lt;br /&gt;20+3250+4816&lt;br /&gt;15+4080!7827&lt;br /&gt;By using delimiter='!+' on the infile statement, SAS will recognize both of these as valid delimiters.&lt;br /&gt;DATA cars;&lt;br /&gt;INFILE 'readdel2.txt' DELIMITER='!+' ;&lt;br /&gt;INPUT mpg weight price;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;PROC PRINT DATA=cars;&lt;br /&gt;RUN;&lt;br /&gt;As you can see in the output below, the data was read properly.&lt;br /&gt;OBS MPG WEIGHT PRICE&lt;br /&gt;1 22 2930 4099&lt;br /&gt;2 17 3350 4749&lt;br /&gt;3 22 2640 3799&lt;br /&gt;4 20 3250 4816&lt;br /&gt;5 15 4080 7827&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-2912442347013876840?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/2912442347013876840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=2912442347013876840' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/2912442347013876840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/2912442347013876840'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/how-do-i-read-file-that-uses-commas.html' title='How do I read a file that uses commas, tabs or spaces as delimiters to separate variables in SAS version 8?'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-432093965767635165</id><published>2007-12-25T23:56:00.000-08:00</published><updated>2007-12-25T23:57:24.566-08:00</updated><title type='text'>The code to produce this listing in PROC REPORT</title><content type='html'>%let lsize=120;&lt;br /&gt;options ls=&amp;lsize;&lt;br /&gt;data _null_;&lt;br /&gt;line=repeat('_',&amp;amp;lsize);&lt;br /&gt;call symput ('ftline',line);&lt;br /&gt;run;&lt;br /&gt;proc sort data=analysis.demo out=demo;&lt;br /&gt;by trtgrpcd siteid subjid;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;proc report data=demo center missing headline headskip nowd spacing=19;&lt;br /&gt;column trtgrpcd trtgrp siteid subjid age sex race;&lt;br /&gt;&lt;br /&gt;define trtgrpcd / group noprint;&lt;br /&gt;define trtgrp / group noprint;&lt;br /&gt;define siteid / group noprint;&lt;br /&gt;define subjid / width=9 "Subject";&lt;br /&gt;define age / center width=6 "Age/(yrs)";&lt;br /&gt;define sex / width=6 "Gender";&lt;br /&gt;define race / width=42 "Race";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;compute before _page_;&lt;br /&gt;line @1 'Treatment Group: ' trtgrp $20.;&lt;br /&gt;line @1 ' ';&lt;br /&gt;endcomp;&lt;br /&gt;compute before siteid;&lt;br /&gt;line @1 'Site Number ' siteid $10.;&lt;br /&gt;endcomp;&lt;br /&gt;compute after _page_;&lt;br /&gt;line @1 "&amp;amp;ftline";&lt;br /&gt;line @1 'NOTE: Patients who failed screening are not included.';&lt;br /&gt;endcomp;&lt;br /&gt;break after trtgrpcd / page;&lt;br /&gt;break after siteid / skip;&lt;br /&gt;title "Listing 3";&lt;br /&gt;title2 "Demographic Characteristics";&lt;br /&gt;run&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-432093965767635165?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/432093965767635165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=432093965767635165' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/432093965767635165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/432093965767635165'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/code-to-produce-this-listing-in-proc.html' title='The code to produce this listing in PROC REPORT'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-4322382530053552178</id><published>2007-12-25T23:49:00.000-08:00</published><updated>2007-12-25T23:51:10.630-08:00</updated><title type='text'>TIPS FOR MAKING YOUR PROC REPORT EASIER</title><content type='html'>There are a number of ways in which rudimentary PROC REPORT output can be&lt;br /&gt;enhanced to achieve the expected outcome. Two of the most useful tools that can be&lt;br /&gt;used to do this include the COMPUTE block and the BREAK statement.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;COMPUTE Blocks.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt; The COMPUTE block is an excellent tool that PROC REPORT&lt;br /&gt;provides to insert characters or text into your report. Footer lines, left-justified subtitles,&lt;br /&gt;and identifying text (e.g. investigative site information that precedes a block of subjects&lt;br /&gt;sharing that particular clinical site) are all examples of items that can be easily produced&lt;br /&gt;through the use of a COMPUTE block.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;BREAK Statement&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;The most common uses of the BREAK statement are to produce line breaks between&lt;br /&gt;observations (or sets of observations) and page breaks between different categories of&lt;br /&gt;observations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-4322382530053552178?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/4322382530053552178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=4322382530053552178' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/4322382530053552178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/4322382530053552178'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/tips-for-making-your-proc-report-easier.html' title='TIPS FOR MAKING YOUR PROC REPORT EASIER'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-40813371159571883</id><published>2007-12-25T04:40:00.000-08:00</published><updated>2007-12-25T04:48:56.513-08:00</updated><title type='text'>ATTRIB Statement</title><content type='html'>&lt;strong&gt;ATTRIB variable-list(s) attribute-list(s)&lt;/strong&gt; ;&lt;br /&gt;&lt;br /&gt;&lt;a name="a000852006"&gt;&lt;/a&gt;Using the ATTRIB statement in the DATA step permanently associates attributes with variables by changing the descriptor information of the SAS data set that contains the variables.&lt;br /&gt;&lt;a name="a000852007"&gt;&lt;/a&gt;You can use ATTRIB in a PROC step, but the rules are different.&lt;br /&gt;&lt;br /&gt;&lt;a name="a002503629"&gt;Arguments&lt;/a&gt;&lt;br /&gt;&lt;a name="a000851986"&gt;&lt;/a&gt;&lt;a name="a000851987"&gt;&lt;/a&gt;&lt;strong&gt;Variable-list&lt;br /&gt;&lt;/strong&gt;&lt;a name="a000851988"&gt;&lt;/a&gt;Names the variables that you want to associate with the attributes.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Tip:List the variables in any form that SAS allows.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name="a000851990"&gt;&lt;/a&gt;&lt;strong&gt;attribute-list&lt;/strong&gt;&lt;br /&gt;&lt;a name="a000851991"&gt;&lt;/a&gt;specifies one or more attributes to assign to variable-list. Specify one or more of these attributes in the ATTRIB statement:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff6666;"&gt;FORMAT=format  INFORMAT=informat   LABEL='label'  &lt;/span&gt;&lt;a name="a000852000"&gt;&lt;/a&gt;&lt;span style="color:#ff6666;"&gt;  LENGTH=&lt;$&gt;length   TRANSCODE=YES  NO.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a name="a000852009"&gt;&lt;/a&gt;Here are examples of ATTRIB statements that contain&lt;br /&gt;&lt;br /&gt;&lt;a name="a000852010"&gt;&lt;/a&gt;·         single variable and single attribute:&lt;br /&gt;            &lt;a name="a000289503"&gt;&lt;/a&gt;attrib cost length=4;&lt;br /&gt;&lt;br /&gt;&lt;a name="a000852011"&gt;&lt;/a&gt;·         single variable with multiple attributes: &lt;a name="a000289504"&gt;&lt;/a&gt;&lt;br /&gt;      attrib saleday informat=mmddyy. format=worddate.;&lt;br /&gt;&lt;br /&gt;&lt;a name="a000852012"&gt;&lt;/a&gt;·         multiple variables with the same multiple attributes:&lt;br /&gt;        &lt;a name="a000289505"&gt;&lt;/a&gt;attrib x y length=$4 label='TEST VARIABLE';&lt;br /&gt;&lt;br /&gt;&lt;a name="a000852013"&gt;&lt;/a&gt;·         multiple variables with different multiple attributes: &lt;a name="a000289506"&gt;&lt;/a&gt;&lt;br /&gt;           attrib x length=$4 label='TEST VARIABLE'       y length=$2 label='RESPONSE';&lt;br /&gt;&lt;br /&gt;&lt;a name="a000852014"&gt;&lt;/a&gt;·         variable list with single attribute:&lt;br /&gt;        &lt;a name="a000289507"&gt;&lt;/a&gt; attrib month1-month12       label='MONTHLY SALES';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-40813371159571883?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/40813371159571883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=40813371159571883' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/40813371159571883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/40813371159571883'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/attrib-statement.html' title='ATTRIB Statement'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-5196361534961628635</id><published>2007-12-25T04:39:00.000-08:00</published><updated>2007-12-25T04:40:16.903-08:00</updated><title type='text'>Filling in Omitted Observations in a Time Series Data Set</title><content type='html'>&lt;a name="idxtsd0353"&gt;&lt;/a&gt;&lt;a name="idxtsd0352"&gt;&lt;/a&gt;Recall that most SAS/ETS procedures expect input data to be in the standard form, with no omitted observations in the sequence of time periods. When data are missing for a time period, the data set should contain a missing observation, in which all variables except the ID variables have missing values.&lt;br /&gt;You can replace omitted observations in a time series data set with missing observations by merging the data set with a data set containing a complete sequence of dates.&lt;br /&gt;The following statements create a monthly data set, OMITTED, from data lines containing records for an intermittent sample of months. (Data values are not shown.) This data set is converted to a standard form time series data set in four steps.&lt;br /&gt;First, the OMITTED data set is sorted to make sure it is in time order. Second, the first and last date in the data set are determined and stored in the data set RANGE. Third, the data set DATES is created containing only the variable DATE and containing monthly observations for the needed time span. Finally, the data sets OMITTED and DATES are merged to produce a standard form time series data set with missing observations inserted for the omitted records.&lt;br /&gt;data omitted;&lt;br /&gt;input date monyy7. x y z;&lt;br /&gt;format date monyy7.;&lt;br /&gt;datalines;&lt;br /&gt;jan1991 ...&lt;br /&gt;mar1991 ...&lt;br /&gt;apr1991 ...&lt;br /&gt;jun1991 ...&lt;br /&gt;... etc. ...&lt;br /&gt;;&lt;br /&gt;&lt;br /&gt;proc sort data=omitted;&lt;br /&gt;by date;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;data range;&lt;br /&gt;retain from to;&lt;br /&gt;set omitted end=lastobs;&lt;br /&gt;if _n_ = 1 then from = date;&lt;br /&gt;if lastobs then do;&lt;br /&gt;to = date;&lt;br /&gt;output;&lt;br /&gt;end;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;data dates;&lt;br /&gt;set range;&lt;br /&gt;date = from;&lt;br /&gt;do while( date &lt;= to );&lt;br /&gt;output;&lt;br /&gt;date = intnx( 'month', date, 1 );&lt;br /&gt;end;&lt;br /&gt;keep date;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;data standard;&lt;br /&gt;merge omitted dates;&lt;br /&gt;by date;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-5196361534961628635?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/5196361534961628635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=5196361534961628635' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/5196361534961628635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/5196361534961628635'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/filling-in-omitted-observations-in-time.html' title='Filling in Omitted Observations in a Time Series Data Set'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-3880010656907383306</id><published>2007-12-25T04:36:00.000-08:00</published><updated>2007-12-25T04:38:45.385-08:00</updated><title type='text'>Computing the Width of a Time Interval</title><content type='html'>&lt;a name="idxtsd0333"&gt;&lt;/a&gt;&lt;a name="idxtsd0332"&gt;&lt;/a&gt;&lt;a name="idxtsd0335"&gt;&lt;/a&gt;&lt;a name="idxtsd0334"&gt;&lt;/a&gt;&lt;a name="idxtsd0337"&gt;&lt;/a&gt;&lt;a name="idxtsd0336"&gt;&lt;/a&gt;To compute the width of a time interval, subtract the ID value of the start of the next interval from the ID value of the start of the current interval.&lt;br /&gt;If the ID values are SAS dates, the width will be in days. If the ID values are SAS datetime values, the width will be in seconds.&lt;br /&gt;&lt;br /&gt;For example, the following statements show how to add a variable WIDTH to the USCPI data set that contains the number of days in the month for each observation:&lt;br /&gt;&lt;br /&gt;data uscpi;&lt;br /&gt;input date date9. cpi;&lt;br /&gt;format date monyy7.;&lt;br /&gt;width = intnx( 'month', date, 1 ) - intnx( 'month', date, 0 );&lt;br /&gt;datalines;&lt;br /&gt;15jun1990 129.9&lt;br /&gt;15jul1990 130.4&lt;br /&gt;15aug1990 131.6&lt;br /&gt;15sep1990 132.7&lt;br /&gt;;&lt;br /&gt;run;&lt;br /&gt;proc print data=uscpi;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-3880010656907383306?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/3880010656907383306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=3880010656907383306' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/3880010656907383306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/3880010656907383306'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/computing-width-of-time-interval.html' title='Computing the Width of a Time Interval'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-7006210636526875125</id><published>2007-12-25T04:29:00.000-08:00</published><updated>2007-12-25T04:36:13.242-08:00</updated><title type='text'>Incrementing Dates by Intervals</title><content type='html'>&lt;a name="idxtsd0305"&gt;&lt;/a&gt;&lt;a name="idxtsd0304"&gt;&lt;/a&gt;&lt;a name="idxtsd0307"&gt;&lt;/a&gt;&lt;a name="idxtsd0306"&gt;&lt;/a&gt;&lt;a name="idxtsd0309"&gt;&lt;/a&gt;&lt;a name="idxtsd0308"&gt;&lt;/a&gt;&lt;a name="idxtsd0311"&gt;&lt;/a&gt;&lt;a name="idxtsd0310"&gt;&lt;/a&gt;Use the INTNX function to increment dates by intervals.&lt;br /&gt; For example, suppose you want to know the date of the start of the week that is six weeks from the week of 17 October 1991. The function INTNX('WEEK','17OCT91'D,6) returns the SAS date value '24NOV1991'D.&lt;br /&gt;&lt;br /&gt;One practical use of the INTNX function is to generate periodic date values. For example, suppose the monthly U.S. Consumer Price Index data in a previous example were recorded without any time identifier on the data records. Given that you know the first observation is for June 1990, the following statements use the INTNX function to compute the ID variable DATE for each observation:&lt;br /&gt;&lt;br /&gt;data exam;&lt;br /&gt;input cpi;&lt;br /&gt;date = intnx( 'month', '1jun1990'd, _n_-1 );&lt;br /&gt;format date monyy7.;&lt;br /&gt;datalines;&lt;br /&gt;129.9&lt;br /&gt;130.4&lt;br /&gt;131.6&lt;br /&gt;132.7&lt;br /&gt;;&lt;br /&gt;proc print data=exam;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;The automatic variable _N_ counts the number of times the DATA step program has executed, and in this case _N_ contains the observation number.&lt;br /&gt;&lt;br /&gt;Thus _N_-1 is the increment needed from the first observation date. Alternatively, we could increment from the month before the first observation, in which case the INTNX function in this example would be written INTNX('MONTH','1MAY1990'D,_N_).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-7006210636526875125?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/7006210636526875125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=7006210636526875125' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/7006210636526875125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/7006210636526875125'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/incrementing-dates-by-intervals.html' title='Incrementing Dates by Intervals'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-7911481218841433775</id><published>2007-12-25T04:18:00.000-08:00</published><updated>2007-12-25T04:22:09.349-08:00</updated><title type='text'>Interval Functions INTNX and INTCK</title><content type='html'>&lt;a name="idxtsd0286"&gt;&lt;/a&gt;&lt;a name="idxtsd0287"&gt;&lt;/a&gt;&lt;a name="idxtsd0289"&gt;&lt;/a&gt;&lt;a name="idxtsd0288"&gt;&lt;/a&gt;The SAS interval functions INTNX and INTCK perform calculations with date, datetime values, and time intervals. They can be used for calendar calculations with SAS date values, to count time intervals between dates, and to increment dates or datetime values by intervals.&lt;br /&gt;&lt;br /&gt;&lt;a name="idxtsd0290"&gt;&lt;/a&gt;&lt;a name="idxtsd0292"&gt;&lt;/a&gt;&lt;a name="idxtsd0291"&gt;&lt;/a&gt;&lt;a name="idxtsd0294"&gt;&lt;/a&gt;&lt;a name="idxtsd0293"&gt;&lt;/a&gt;&lt;a name="idxtsd0296"&gt;&lt;/a&gt;&lt;a name="idxtsd0295"&gt;&lt;/a&gt;The INTNX function increments dates by intervals. INTNX computes the date or datetime of the start of the interval a specified number of intervals from the interval containing a given date or datetime value.&lt;br /&gt;&lt;br /&gt;The form of the INTNX function is&lt;br /&gt;&lt;strong&gt;INTNX( interval, from, n &lt;, alignment &gt; ) &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;where:&lt;br /&gt;interval&lt;br /&gt;is a character constant or variable containing an interval name.&lt;br /&gt;from is a SAS date value (for date intervals) or&lt;br /&gt; datetime value (for datetime intervals).&lt;br /&gt;&lt;br /&gt;n is the number of intervals to increment from the interval containing the from value.&lt;br /&gt;alignment controls the alignment of SAS dates, within the interval, used to identify output observations. Can take the values BEGINNINGB, MIDDLEM, or ENDE.&lt;br /&gt;&lt;br /&gt; The number of intervals to increment, n, can be positive, negative, or zero. For example, the statement NEXTMON = INTNX('MONTH',DATE,1); assigns to the variable NEXTMON the date of the first day of the month following the month containing the value of DATE. &lt;a name="idxtsd0297"&gt;&lt;/a&gt;&lt;a name="idxtsd0299"&gt;&lt;/a&gt;&lt;a name="idxtsd0298"&gt;&lt;/a&gt;&lt;a name="idxtsd0301"&gt;&lt;/a&gt;&lt;a name="idxtsd0300"&gt;&lt;/a&gt;&lt;a name="idxtsd0303"&gt;&lt;/a&gt;&lt;a name="idxtsd0302"&gt;&lt;/a&gt;The INTCK function counts the number of interval boundaries between two dates or between two datetime values.&lt;br /&gt;&lt;br /&gt;The form of the INTCK function is INTCK( interval, from, to ) where:&lt;br /&gt;interval is a character constant or variable containing an interval name&lt;br /&gt;from is the starting date (for date intervals) or datetime value (for datetime intervals)&lt;br /&gt;to is the ending date (for date intervals) or datetime value (for datetime intervals).&lt;br /&gt;&lt;br /&gt;For example, the statement NEWYEARS = INTCK('YEAR',DATE1,DATE2); assigns to the variable NEWYEARS the number of New Year's Days between the two dates.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-7911481218841433775?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/7911481218841433775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=7911481218841433775' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/7911481218841433775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/7911481218841433775'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/interval-functions-intnx-and-intck.html' title='Interval Functions INTNX and INTCK'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-91805731642023768</id><published>2007-12-25T04:16:00.000-08:00</published><updated>2007-12-25T04:18:27.635-08:00</updated><title type='text'>Computing Calendar and Time Variables</title><content type='html'>&lt;a name="idxtsd0279"&gt;&lt;/a&gt;&lt;a name="idxtsd0278"&gt;&lt;/a&gt;&lt;a name="idxtsd0281"&gt;&lt;/a&gt;&lt;a name="idxtsd0280"&gt;&lt;/a&gt;&lt;a name="idxtsd0283"&gt;&lt;/a&gt;&lt;a name="idxtsd0282"&gt;&lt;/a&gt;&lt;a name="idxtsd0285"&gt;&lt;/a&gt;&lt;a name="idxtsd0284"&gt;&lt;/a&gt;The functions HOUR, MINUTE, and SECOND compute time variables from SAS datetime values. The DATEPART function and the date-to-calendar variables functions can be combined to compute calendar variables from datetime values.&lt;br /&gt;For example, suppose the date and time of the tri-hourly temperature data in the preceding example were recorded as datetime values in the datetime format. The following statements show how to compute the YEAR, MONTH, DAY, and HOUR of each observation and include these variables in the SAS data set:&lt;br /&gt;&lt;br /&gt;data Test;&lt;br /&gt;input datetime datetime13. temp;&lt;br /&gt;format datetime datetime10.;&lt;br /&gt;hour = hour( datetime );&lt;br /&gt;date = datepart( datetime );&lt;br /&gt;year = year( date );&lt;br /&gt;month = month( date );&lt;br /&gt;day = day( date );&lt;br /&gt;datalines;&lt;br /&gt;16oct91:21:00 61&lt;br /&gt;17oct91:00:00 56&lt;br /&gt;17oct91:03:00 53&lt;br /&gt;17oct91:06:00 54&lt;br /&gt;17oct91:09:00 65&lt;br /&gt;17oct91:12:00 72&lt;br /&gt;;&lt;br /&gt;&lt;br /&gt;proc print data=Test;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-91805731642023768?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/91805731642023768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=91805731642023768' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/91805731642023768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/91805731642023768'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/computing-calendar-and-time-variables.html' title='Computing Calendar and Time Variables'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-9148880955921963370</id><published>2007-12-25T04:14:00.000-08:00</published><updated>2007-12-25T04:16:34.320-08:00</updated><title type='text'>Computing Datetime Values</title><content type='html'>&lt;a name="idxtsd0275"&gt;&lt;/a&gt;&lt;a name="idxtsd0274"&gt;&lt;/a&gt;&lt;a name="idxtsd0277"&gt;&lt;/a&gt;&lt;a name="idxtsd0276"&gt;&lt;/a&gt;To compute datetime ID values from calendar and time variables, first compute the date and then compute the datetime with DHMS.&lt;br /&gt;For example, suppose you read tri-hourly temperature data with time recorded as YEAR, MONTH, DAY, and HOUR. The following statements show how to compute the ID variable DATETIME:&lt;br /&gt;&lt;br /&gt;data weather;&lt;br /&gt;input year month day hour temp;&lt;br /&gt;datetime = dhms( mdy( month, day, year ), hour, 0, 0 );&lt;br /&gt;format datetime datetime10.;&lt;br /&gt;datalines;&lt;br /&gt;91 10 16 21 61&lt;br /&gt;91 10 17 0 56&lt;br /&gt;91 10 17 3 53&lt;br /&gt;91 10 17 6 54&lt;br /&gt;91 10 17 9 65&lt;br /&gt;91 10 17 12 72&lt;br /&gt;;&lt;br /&gt;&lt;br /&gt;proc print data=weather;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-9148880955921963370?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/9148880955921963370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=9148880955921963370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/9148880955921963370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/9148880955921963370'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/computing-datetime-values.html' title='Computing Datetime Values'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-3191183364838642720</id><published>2007-12-25T04:13:00.000-08:00</published><updated>2007-12-25T04:14:12.852-08:00</updated><title type='text'>Converting between Date, Datetime, and Time Values</title><content type='html'>&lt;a name="idxtsd0267"&gt;&lt;/a&gt;&lt;a name="idxtsd0266"&gt;&lt;/a&gt;&lt;a name="idxtsd0269"&gt;&lt;/a&gt;&lt;a name="idxtsd0268"&gt;&lt;/a&gt;&lt;a name="idxtsd0270"&gt;&lt;/a&gt;&lt;a name="idxtsd0271"&gt;&lt;/a&gt;The DATEPART function computes the SAS date value for the date part of a SAS datetime value.&lt;br /&gt;&lt;br /&gt;The TIMEPART function computes the SAS time value for the time part of a SAS datetime value.&lt;br /&gt;&lt;br /&gt;&lt;a name="idxtsd0272"&gt;&lt;/a&gt;The HMS function computes SAS time values from HOUR, MINUTE, and SECOND time variables.&lt;br /&gt;&lt;br /&gt;&lt;a name="idxtsd0273"&gt;&lt;/a&gt;The DHMS function computes a SAS datetime value from a SAS date value and HOUR, MINUTE, and SECOND time variables.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-3191183364838642720?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/3191183364838642720/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=3191183364838642720' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/3191183364838642720'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/3191183364838642720'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/converting-between-date-datetime-and.html' title='Converting between Date, Datetime, and Time Values'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-8993522557558418584</id><published>2007-12-25T04:10:00.000-08:00</published><updated>2007-12-25T04:12:48.760-08:00</updated><title type='text'>Computing Calendar Variables from Dates</title><content type='html'>&lt;a name="idxtsd0258"&gt;&lt;/a&gt;&lt;a name="idxtsd0257"&gt;&lt;/a&gt;&lt;a name="idxtsd0260"&gt;&lt;/a&gt;&lt;a name="idxtsd0259"&gt;&lt;/a&gt;&lt;a name="idxtsd0261"&gt;&lt;/a&gt;&lt;a name="idxtsd0262"&gt;&lt;/a&gt;&lt;a name="idxtsd0263"&gt;&lt;/a&gt;&lt;a name="idxtsd0264"&gt;&lt;/a&gt;&lt;a name="idxtsd0265"&gt;&lt;/a&gt;The functions YEAR, MONTH, DAY, WEEKDAY, and JULDATE compute calendar variables from SAS date values.&lt;br /&gt;&lt;br /&gt;Returning to the example of reading the USCPI data from records containing date values represented in the MONYY format, you can find the month and year of each observation from the SAS dates of the observations using the following statements.&lt;br /&gt;&lt;br /&gt;data uscpi;&lt;br /&gt;input date monyy7. cpi;&lt;br /&gt;format date monyy7.;&lt;br /&gt;year = year( date );&lt;br /&gt;month = month( date );&lt;br /&gt;&lt;br /&gt;datalines;&lt;br /&gt;&lt;br /&gt;jun1990 129.9&lt;br /&gt;jul1990 130.4&lt;br /&gt;aug1990 131.6&lt;br /&gt;sep1990 132.7&lt;br /&gt;;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;proc print data=uscpi;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-8993522557558418584?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/8993522557558418584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=8993522557558418584' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/8993522557558418584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/8993522557558418584'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/computing-calendar-variables-from-dates.html' title='Computing Calendar Variables from Dates'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-3485015969710612449</id><published>2007-12-25T04:09:00.000-08:00</published><updated>2007-12-25T04:10:12.194-08:00</updated><title type='text'>Computing Dates from Calendar Variables</title><content type='html'>The MDY function converts MONTH, DAY, and YEAR values to a SAS date value. For example, MDY(10,17,91) returns the SAS date value '17OCT91'D.&lt;br /&gt;&lt;a name="idxtsd0255"&gt;&lt;/a&gt;The YYQ function computes the SAS date for the first day of a quarter. For example, YYQ(91,4) returns the SAS date value '1OCT91'D.&lt;br /&gt;&lt;a name="idxtsd0256"&gt;&lt;/a&gt;The DATEJUL function computes the SAS date for a Julian date. For example, DATEJUL(91290) returns the SAS date '17OCT91'D.&lt;br /&gt;The YYQ and MDY functions are useful for creating SAS date variables when the ID values recorded in the data are year and quarter; year and month; or year, month, and day, instead of dates that can be read with a date informat.&lt;br /&gt;For example, the following statements read quarterly estimates of the gross national product of the U.S. from 1990:I to 1991:II from data records on which dates are coded as separate year and quarter values. The YYQ function is used to compute the variable DATE.&lt;br /&gt; &lt;br /&gt; data usecon;&lt;br /&gt;      input year qtr gnp;&lt;br /&gt;      date = yyq( year, qtr );&lt;br /&gt;      format date yyqc.;&lt;br /&gt;   datalines;&lt;br /&gt;   1990 1 5375.4&lt;br /&gt;   1990 2 5443.3&lt;br /&gt;   1990 3 5514.6&lt;br /&gt;   1990 4 5527.3&lt;br /&gt;   1991 1 5557.7&lt;br /&gt;   1991 2 5615.8&lt;br /&gt;   ;&lt;br /&gt;proc print data=usecon;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-3485015969710612449?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/3485015969710612449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=3485015969710612449' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/3485015969710612449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/3485015969710612449'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/computing-dates-from-calendar-variables.html' title='Computing Dates from Calendar Variables'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-8758941300914579638</id><published>2007-12-25T02:35:00.001-08:00</published><updated>2007-12-25T02:35:40.997-08:00</updated><title type='text'>Program on Merging DATA SETS</title><content type='html'>DATA one;&lt;br /&gt;INPUT id $ fruit $;&lt;br /&gt;DATALINES;&lt;br /&gt;a apple&lt;br /&gt;a apple&lt;br /&gt;b banana&lt;br /&gt;c coconut&lt;br /&gt;c coconut&lt;br /&gt;c coconut&lt;br /&gt;;&lt;br /&gt;PROC SORT data=one;&lt;br /&gt;BY id;&lt;br /&gt;RUN;&lt;br /&gt;/* Note there are two B's and two C's in TWO */&lt;br /&gt;DATA two;&lt;br /&gt;INPUT id $ color $;&lt;br /&gt;DATALINES;&lt;br /&gt;a amber&lt;br /&gt;b brown&lt;br /&gt;b black&lt;br /&gt;c cocoa&lt;br /&gt;c cream&lt;br /&gt;;&lt;br /&gt;PROC SORT data=two;&lt;br /&gt;BY id;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;DATA test;&lt;br /&gt;MERGE one two;&lt;br /&gt;BY id;&lt;br /&gt;RUN;&lt;br /&gt;PROC PRINT;&lt;br /&gt;RUN;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-8758941300914579638?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/8758941300914579638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=8758941300914579638' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/8758941300914579638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/8758941300914579638'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/program-on-merging-data-sets_2244.html' title='Program on Merging DATA SETS'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-972761457377549616</id><published>2007-12-25T02:33:00.000-08:00</published><updated>2007-12-25T02:34:35.085-08:00</updated><title type='text'>Program on Merging DATA SETS</title><content type='html'>DATA one;&lt;br /&gt;INPUT x $;&lt;br /&gt;DATALINES;&lt;br /&gt;cat&lt;br /&gt;catnap&lt;br /&gt;catnip&lt;br /&gt;;&lt;br /&gt;DATA two;&lt;br /&gt;INPUT x $3. y ;&lt;br /&gt;DATALINES;&lt;br /&gt;cat 111&lt;br /&gt;dog 222&lt;br /&gt;;&lt;br /&gt;DATA badmerge;&lt;br /&gt;MERGE two one;    /* Shorter length for X listed first to illustrate the&lt;br /&gt;truncation */&lt;br /&gt;&lt;br /&gt;BY x;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;PROC PRINT;&lt;br /&gt;RUN;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-972761457377549616?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/972761457377549616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=972761457377549616' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/972761457377549616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/972761457377549616'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/program-on-merging-data-sets_25.html' title='Program on Merging DATA SETS'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-1774962405375887656</id><published>2007-12-25T02:29:00.000-08:00</published><updated>2007-12-25T02:32:29.285-08:00</updated><title type='text'>Program on merging data sets</title><content type='html'>data data1;&lt;br /&gt;input a1 b1 ;&lt;br /&gt;cards ;&lt;br /&gt;11 22&lt;br /&gt;1 1&lt;br /&gt;;&lt;br /&gt;run ;&lt;br /&gt;data data2;&lt;br /&gt; input a2 b2 ;&lt;br /&gt;cards ;&lt;br /&gt;33 44&lt;br /&gt;;&lt;br /&gt;run ;&lt;br /&gt;data data3;&lt;br /&gt; input a3 b3 ;&lt;br /&gt;cards ;&lt;br /&gt;55 66&lt;br /&gt;;&lt;br /&gt;run ;&lt;br /&gt;data data4;&lt;br /&gt;input a4 b4 ;&lt;br /&gt; cards ;&lt;br /&gt;77 88&lt;br /&gt;;&lt;br /&gt; run ;&lt;br /&gt;data data5;&lt;br /&gt;input a5 b5 ;&lt;br /&gt;cards ;&lt;br /&gt;99 100&lt;br /&gt;123 234223&lt;br /&gt;1223 421321&lt;br /&gt;;&lt;br /&gt; run ;&lt;br /&gt;&lt;br /&gt;data new ; /*The Mergerd data set */&lt;br /&gt; merge data1 data2 data3 data4 data5 ;&lt;br /&gt; run ;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-1774962405375887656?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/1774962405375887656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=1774962405375887656' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1774962405375887656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/1774962405375887656'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/program-on-merging-data-sets.html' title='Program on merging data sets'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-6895453620242369604</id><published>2007-12-25T02:26:00.000-08:00</published><updated>2007-12-25T02:28:18.187-08:00</updated><title type='text'>Program on LABELING</title><content type='html'>DATA auto ;&lt;br /&gt;  INPUT make $  mpg rep78 weight foreign ;&lt;br /&gt;CARDS;&lt;br /&gt;AMC     22 3 2930 0&lt;br /&gt;AMC     17 3 3350 0&lt;br /&gt;AMC     22 . 2640 0&lt;br /&gt;Audi    17 5 2830 1&lt;br /&gt;Audi    23 3 2070 1&lt;br /&gt;BMW     25 4 2650 1&lt;br /&gt;Buick   20 3 3250 0&lt;br /&gt;Buick   15 4 4080 0&lt;br /&gt;Buick   18 3 3670 0&lt;br /&gt;Buick   26 . 2230 0&lt;br /&gt;Buick   20 3 3280 0&lt;br /&gt;Buick   16 3 3880 0&lt;br /&gt;Buick   19 3 3400 0&lt;br /&gt;Cad.    14 3 4330 0&lt;br /&gt;Cad.    14 2 3900 0&lt;br /&gt;Cad.    21 3 4290 0&lt;br /&gt;Chev.   29 3 2110 0&lt;br /&gt;Chev.   16 4 3690 0&lt;br /&gt;Chev.   22 3 3180 0&lt;br /&gt;Chev.   22 2 3220 0&lt;br /&gt;Chev.   24 2 2750 0&lt;br /&gt;Chev.   19 3 3430 0&lt;br /&gt;Datsun  23 4 2370 1&lt;br /&gt;Datsun  35 5 2020 1&lt;br /&gt;Datsun  24 4 2280 1&lt;br /&gt;Datsun  21 4 2750 1&lt;br /&gt;;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;DATA auto2;&lt;br /&gt;   SET auto;&lt;br /&gt;&lt;br /&gt;   LABEL rep78  ="1978 Repair Record"&lt;br /&gt;          mpg    ="Miles Per Gallon"&lt;br /&gt;          foreign="Where Car Was Made";&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;PROC CONTENTS DATA=auto2;&lt;br /&gt;RUN;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-6895453620242369604?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/6895453620242369604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=6895453620242369604' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/6895453620242369604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/6895453620242369604'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/program-on-labeling.html' title='Program on LABELING'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-4533383682730947064</id><published>2007-12-25T02:18:00.000-08:00</published><updated>2007-12-25T02:19:43.002-08:00</updated><title type='text'>Reading the Multiple files in the INFILE statement</title><content type='html'>Following is the example of the external file called extfile1:     &lt;br /&gt;                                                                       &lt;br /&gt;--------10-------20------                                           &lt;br /&gt;05JAN2001 6 W12301 1.59 9.54                                           &lt;br /&gt;12JAN2001 3 P01219 2.99 8.97                                           &lt;br /&gt;16JAN2001 1 A00101 3.00 3.00                                           &lt;br /&gt;19JAN2001 3 A00101 3.00 9.00                                           &lt;br /&gt;24JAN2001 2 B90035 2.59 5.18                                           &lt;br /&gt;                                                                                                                                          &lt;br /&gt;                                                                       &lt;br /&gt;/*  Following is the example of the external file called extfile2:  &lt;br /&gt;&lt;br /&gt;--------10-------20------                                       &lt;br /&gt;02FEB2001 1 P01219 2.99 2.99                                       &lt;br /&gt;05FEB2001 3 A00901 1.99 5.97                                       &lt;br /&gt;07FEB2001 2 C21135 3.00 6.00                                       &lt;br /&gt;14FEB2001 7 B90035 2.59 18.13                                      &lt;br /&gt;20FEB2001 6 A00901 1.99 11.94                                      &lt;br /&gt;27FEB2001 1 W12301 1.59 1.59                                       &lt;br /&gt;27FEB2001 2 C00300 1.00 2.00                                       &lt;br /&gt;28FEB2001 2 B90035 2.59 5.18                                       &lt;br /&gt;                                                                                                                       &lt;br /&gt;                                                                   &lt;br /&gt;/*  Following is the example of the external file called extfile3: &lt;br /&gt;                                                                   &lt;br /&gt;--------10-------20------                                       &lt;br /&gt;06MAR2001 4 A00101 3.59 14.36                                      &lt;br /&gt;12MAR2001 2 P01219 2.99 5.98                                       &lt;br /&gt;13MAR2001 2 A00101 3.00 6.00                                       &lt;br /&gt;16MAR2001 3 B90035 2.59 7.77                                       &lt;br /&gt;16MAR2001 1 W99201 5.50 5.50                                       &lt;br /&gt;21MAR2001 3 C30660 2.00 6.00                                       &lt;br /&gt;29MAR2001 5 A00901 1.99 9.95                                       &lt;br /&gt;                                                                &lt;br /&gt;&lt;br /&gt;data qrt1;                                                     &lt;br /&gt;infile "('c:\extfile1','c:\extfile2','c:\extfile3')" truncover;&lt;br /&gt;input @1 date date9. @11 quanity item $ price totcost;         &lt;br /&gt;format date date9. price totcost dollar8.2;     &lt;br /&gt;              &lt;br /&gt;proc print;      &lt;br /&gt;    run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-4533383682730947064?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/4533383682730947064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=4533383682730947064' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/4533383682730947064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/4533383682730947064'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/reading-multiple-files-in-infile.html' title='Reading the Multiple files in the INFILE statement'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-2328443741058765007</id><published>2007-12-25T02:17:00.000-08:00</published><updated>2007-12-25T02:18:14.889-08:00</updated><title type='text'>Reading free formatted (tab delimited) data from an external file</title><content type='html'>AMC     Concord 22      2930    4099&lt;br /&gt;AMC     Pacer   17      3350    4749&lt;br /&gt;AMC     Spirit  22      2640    3799&lt;br /&gt;Buick   Century 20      3250    4816&lt;br /&gt;Buick   Electra 15      4080    7827&lt;br /&gt;&lt;br /&gt;To read the data from cars6.dat into SAS, use the following syntax:&lt;br /&gt;&lt;br /&gt;DATA cars6;&lt;br /&gt;  INFILE "c:\carsdata\cars6.dat" DELIMITER='09'x;&lt;br /&gt;  INPUT make $ model $ mpg weight price;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;TITLE "cars6 data";&lt;br /&gt;PROC PRINT DATA=cars6(OBS=5);&lt;br /&gt;RUN;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-2328443741058765007?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/2328443741058765007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=2328443741058765007' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/2328443741058765007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/2328443741058765007'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/reading-free-formatted-tab-delimited.html' title='Reading free formatted (tab delimited) data from an external file'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-5631742051577270268</id><published>2007-12-25T02:16:00.000-08:00</published><updated>2007-12-25T02:17:16.046-08:00</updated><title type='text'>Reading free formatted (comma delimited) data from an external file</title><content type='html'>AMC,Concord,22,2930,4099&lt;br /&gt;AMC,Pacer,17,3350,4749&lt;br /&gt;AMC,Spirit,22,2640,3799&lt;br /&gt;Buick,Century,20,3250,4816&lt;br /&gt;Buick,Electra,15,4080,7827&lt;br /&gt;&lt;br /&gt;To read the data from cars5.dat into SAS, use the following syntax:&lt;br /&gt;&lt;br /&gt;DATA cars5;&lt;br /&gt;  INFILE "c:\carsdata\cars5.dat" delimiter=',';&lt;br /&gt;  INPUT make $ model $ mpg weight price;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;TITLE "cars5 data";&lt;br /&gt;PROC PRINT DATA=cars5(OBS=5);&lt;br /&gt;RUN;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-5631742051577270268?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/5631742051577270268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=5631742051577270268' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/5631742051577270268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/5631742051577270268'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/reading-free-formatted-comma-delimited.html' title='Reading free formatted (comma delimited) data from an external file'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-3860174160891446417</id><published>2007-12-25T02:13:00.000-08:00</published><updated>2007-12-25T02:15:45.641-08:00</updated><title type='text'>Reading fixed formatted data from an external file</title><content type='html'>AMC  Concord2229304099&lt;br /&gt;AMC  Pacer  1733504749&lt;br /&gt;AMC  Spirit 2226403799&lt;br /&gt;BuickCentury2032504816&lt;br /&gt;BuickElectra1540807827&lt;br /&gt;&lt;br /&gt;To read the file cars3.dat, use the following syntax.&lt;br /&gt; DATA cars3;&lt;br /&gt;  INFILE "c:\carsdata\cars3.dat";&lt;br /&gt;  INPUT make $ 1-5 model $ 6-12 mpg 13-14 weight 15-18 price 19-22;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;TITLE "cars3 data";&lt;br /&gt;PROC PRINT DATA=cars3 (obs=5);&lt;br /&gt;RUN;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-3860174160891446417?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/3860174160891446417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=3860174160891446417' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/3860174160891446417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/3860174160891446417'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/reading-fixed-formatted-data-from.html' title='Reading fixed formatted data from an external file'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-7611768887966666205</id><published>2007-12-25T02:07:00.000-08:00</published><updated>2007-12-25T02:13:35.630-08:00</updated><title type='text'>How can I get information to debug my SAS macro?</title><content type='html'>You can use the mprint and mlogic options to get information to help debug your macro.  Consider the example below.&lt;br /&gt;&lt;br /&gt;It is quite easy to read a file that uses a space as a delimiter to separate variables in your raw data file. Consider the sample below.  The macro test has an error on the proc sort statement where it says data=on instead of data=one.&lt;br /&gt;&lt;br /&gt;options mlogic mprint;&lt;br /&gt; %macro test;&lt;br /&gt; data one; &lt;br /&gt;  do i = 1 to 100;  &lt;br /&gt;     x = ranuni(-1);   &lt;br /&gt;    output;   &lt;br /&gt;  end;&lt;br /&gt; run;&lt;br /&gt;  proc sort data=on out=two;  &lt;br /&gt; by x;&lt;br /&gt;  run;&lt;br /&gt;%mend;&lt;br /&gt;%test;&lt;br /&gt;&lt;br /&gt;Because we included options mlogic mprint; at the top of the program, we get information which helps us pinpoint the problem.  The message ERROR: File WORK.ON.DATA does not exist. (which we put in red for emphasis) shows us the error.  Without the options mlogic mprint; we would have not known where the error occurred.&lt;br /&gt;&lt;br /&gt;MLOGIC(TEST):  Beginning execution.&lt;br /&gt;MPRINT(TEST):   data one;&lt;br /&gt;MPRINT(TEST):   do i = 1 to 100;&lt;br /&gt;MPRINT(TEST):   x = ranuni(-1);&lt;br /&gt;MPRINT(TEST):   output;&lt;br /&gt;MPRINT(TEST):   end;&lt;br /&gt;MPRINT(TEST):   run;&lt;br /&gt;&lt;br /&gt; NOTE: The data set WORK.ONE has 100 observations and 2 variables.&lt;br /&gt;NOTE: DATA statement used:  &lt;br /&gt;              real time           0.02 seconds   &lt;br /&gt;              cpu time            0.02 seconds&lt;br /&gt;&lt;br /&gt; ERROR: File WORK.ON.DATA does not exist.&lt;br /&gt;MPRINT(TEST): proc sort data=on out=two;&lt;br /&gt;MPRINT(TEST):   by x;&lt;br /&gt;MPRINT(TEST):   run;&lt;br /&gt;&lt;br /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;br /&gt;WARNING: The data set WORK.TWO may be incomplete. &lt;br /&gt;                      When this step was stopped there were&lt;br /&gt;                   0         observations and 0 variables.&lt;br /&gt;&lt;br /&gt;WARNING: Data set WORK.TWO was not replaced because this step was stopped.&lt;br /&gt;NOTE: PROCEDURE SORT used:    &lt;br /&gt;                real time           0.02 seconds   &lt;br /&gt;                cpu time            0.02 seconds&lt;br /&gt;MLOGIC(TEST):  Ending execution.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-7611768887966666205?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/7611768887966666205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=7611768887966666205' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/7611768887966666205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/7611768887966666205'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/how-can-i-get-information-to-debug-my.html' title='How can I get information to debug my SAS macro?'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-7739300108395976087</id><published>2007-12-25T02:05:00.000-08:00</published><updated>2007-12-25T02:07:19.125-08:00</updated><title type='text'>How to Create a SAS Data Set with Compressed Observations?</title><content type='html'>The two ways to compress data sets in SAS:&lt;br /&gt;&lt;br /&gt;Using the option in the DATA step to compress a data set:&lt;br /&gt;&lt;br /&gt;Data ssd.income &lt;strong&gt;(compress=yes);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;To compress all data sets created within a SAS sessions:&lt;br /&gt;Options &lt;strong&gt;compress=yes&lt;/strong&gt;;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-7739300108395976087?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/7739300108395976087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=7739300108395976087' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/7739300108395976087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/7739300108395976087'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/how-to-create-sas-data-set-with.html' title='How to Create a SAS Data Set with Compressed Observations?'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-8455667113343140923</id><published>2007-12-24T05:28:00.000-08:00</published><updated>2007-12-24T05:31:24.448-08:00</updated><title type='text'>using a DO loop with a DO UNTIL</title><content type='html'>data one;&lt;br /&gt; input lastname: $15. typeofcar: $15. mileage;&lt;br /&gt;datalines;&lt;br /&gt;Jones Toyota 7435&lt;br /&gt;Smith Toyota 13001&lt;br /&gt;Jones2 Ford 3433&lt;br /&gt;Smith2 Toyota 15032&lt;br /&gt;Shepherd Nissan 4300&lt;br /&gt;Shepherd2 Honda 5582&lt;br /&gt;Williams Ford 10532&lt;br /&gt;;&lt;br /&gt;data two;&lt;br /&gt; input startrange endrange typeofservice &amp;amp; $35.;&lt;br /&gt;datalines;&lt;br /&gt;3000 5000 oil change&lt;br /&gt;5001 6000 overdue oil change&lt;br /&gt;6001 8000 oil change and tire rotation&lt;br /&gt;8001 9000 overdue oil change&lt;br /&gt;9001 11000 oil change&lt;br /&gt;11001 12000 overdue oil change&lt;br /&gt;12001 14000 oil change and tire rotation&lt;br /&gt;14001 14999 overdue oil change&lt;br /&gt;15000 15999 15000 mile check&lt;br /&gt;;&lt;br /&gt;&lt;br /&gt;data combine;&lt;br /&gt; set one;&lt;br /&gt; found=0;&lt;br /&gt; do i=1 to nobs until (found);   &lt;br /&gt; set two point=i nobs=nobs;  &lt;br /&gt;  if startrange &lt;= mileage &lt;= endrange then do;  &lt;br /&gt;     output;   &lt;br /&gt;    found=1;&lt;br /&gt;    end;&lt;br /&gt; end;&lt;br /&gt;run;&lt;br /&gt;proc print;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-8455667113343140923?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/8455667113343140923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=8455667113343140923' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/8455667113343140923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/8455667113343140923'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/using-do-loop-with-do-until.html' title='using a DO loop with a DO UNTIL'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-3942350732851117185</id><published>2007-12-24T05:26:00.000-08:00</published><updated>2007-12-24T05:27:43.307-08:00</updated><title type='text'>Iterative DO loop using WHILE</title><content type='html'>data one; &lt;br /&gt;drop i; &lt;br /&gt;input v1-v4; &lt;br /&gt;array v(4);&lt;br /&gt; count=0;&lt;br /&gt; do i=1 to 4 while (v{i}=1);   &lt;br /&gt;count +1; &lt;br /&gt;end;&lt;br /&gt;datalines;&lt;br /&gt;1 1 0 1&lt;br /&gt;1 1 1 0&lt;br /&gt;1 0 1 1&lt;br /&gt;0 1 0 0&lt;br /&gt;;&lt;br /&gt;&lt;br /&gt;proc print;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-3942350732851117185?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/3942350732851117185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=3942350732851117185' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/3942350732851117185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/3942350732851117185'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/iterative-do-loop-using-while.html' title='Iterative DO loop using WHILE'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-5485457328746842235</id><published>2007-12-24T05:22:00.000-08:00</published><updated>2007-12-24T05:25:50.305-08:00</updated><title type='text'>Determine the maximum number of consecutive missing values per observation</title><content type='html'>data mydata; &lt;br /&gt;input id x1 x2 x3 x4 x5;&lt;br /&gt;datalines;&lt;br /&gt;1 2 . . . .&lt;br /&gt;2  2 1 2 1 .&lt;br /&gt;3 . 1 . 1 .&lt;br /&gt;4 1 . . . 1&lt;br /&gt;5 . . . 1 .&lt;br /&gt;;&lt;br /&gt;&lt;br /&gt;data mydata2;&lt;br /&gt; set mydata; &lt;br /&gt;array test(5) x1-x5; &lt;br /&gt;array hold(5);&lt;br /&gt; count=0;&lt;br /&gt; do i=1 to 5; &lt;br /&gt;  if test(i) =. then count+1; &lt;br /&gt;  if test(i) ne .  or i=5 then do; &lt;br /&gt;    hold(i)=count;  &lt;br /&gt;   count=0;&lt;br /&gt;   end;&lt;br /&gt; end; &lt;br /&gt;highcnt=max(of hold1-hold5); &lt;br /&gt;drop i count;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;proc print noobs;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-5485457328746842235?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/5485457328746842235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=5485457328746842235' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/5485457328746842235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/5485457328746842235'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/determine-maximum-number-of-consecutive.html' title='Determine the maximum number of consecutive missing values per observation'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-3663563390898138355</id><published>2007-12-24T05:19:00.000-08:00</published><updated>2007-12-24T05:22:45.506-08:00</updated><title type='text'>Create multiple observations from a single observation using multidimensional arrays</title><content type='html'>data frame;&lt;br /&gt; input men1 men2 men3 men4 men5 woman1 woman2 woman3 woman4 woman5;&lt;br /&gt;datalines;&lt;br /&gt;1 2 3 4 5 6 7 8 9 10&lt;br /&gt;2 3 4 5 6 7 8 9 10 11&lt;br /&gt;3 4 5 6 7 8 9 10 11 12&lt;br /&gt;;&lt;br /&gt;  data restructured (drop=men1--j);&lt;br /&gt; set frame; &lt;br /&gt;array SexRegion [2,5] men1--woman5;&lt;br /&gt; do i=1 to 2; &lt;br /&gt;  do j=1 to 5; &lt;br /&gt;    if i=1 then sex='M'; &lt;br /&gt;    else sex='F';   &lt;br /&gt;  region=j; &lt;br /&gt;    size=SexRegion[i,j]; &lt;br /&gt;    output;&lt;br /&gt;   end; &lt;br /&gt;end;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;proc print;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-3663563390898138355?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/3663563390898138355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=3663563390898138355' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/3663563390898138355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/3663563390898138355'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/create-multiple-observations-from.html' title='Create multiple observations from a single observation using multidimensional arrays'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3109214023915898482.post-2854945292183217281</id><published>2007-12-24T05:03:00.000-08:00</published><updated>2007-12-24T05:12:25.348-08:00</updated><title type='text'>Scanning for words in a string</title><content type='html'>Data one;&lt;br /&gt; input name $30.;&lt;br /&gt;datalines;&lt;br /&gt;daniel  john green&lt;br /&gt;mary jane smith&lt;br /&gt;kathy diane  jones&lt;br /&gt;; &lt;br /&gt;&lt;br /&gt;data two (drop=name i);&lt;br /&gt;  set one;&lt;br /&gt;  length first $10 middle $10 last $12; &lt;br /&gt;array names(3) $ first middle last; &lt;br /&gt;&lt;br /&gt;do i= 1 to 3;  &lt;br /&gt; names(i)=scan(name,i,' ');&lt;br /&gt; end;&lt;br /&gt;run;&lt;br /&gt; proc print;&lt;br /&gt;run;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3109214023915898482-2854945292183217281?l=learningworld-baithi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningworld-baithi.blogspot.com/feeds/2854945292183217281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3109214023915898482&amp;postID=2854945292183217281' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/2854945292183217281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3109214023915898482/posts/default/2854945292183217281'/><link rel='alternate' type='text/html' href='http://learningworld-baithi.blogspot.com/2007/12/scanning-for-words-in-string.html' title='Scanning for words in a string'/><author><name>Srini</name><uri>http://www.blogger.com/profile/14942816961663034859</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
