Go Back   Rhinocerus > Newsgroup > Newsgroup comp.soft-sys.sas

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 10-27-2005, 06:36 AM
David L Cassell
Guest
 
Posts: n/a
Default Re: How to call another program within a program in SAS???

oseithedude@GMAIL.COM wrote:
>Hey, I have a SAS program that, among other things, creates a dataset
>containing "bad" observations that I have no use for. There are about
>2,000 of these "bad" observations in the data set but there may be
>10-15 "good" observations that I want to keep in the dataset. There is
>a variable in the data set called "line" and each observation has a
>different "line" number. I have 2,000 "line" numbers that I have thrown
>into a if... not in statement that can delete all of the 2000 "bad"
>observations as follows:
>
>data program;
>set original;
>if line not in ('1','456','767',etc..[2,000 numbers within this
>statement].);
>run;
>
>I don't want to put the program above within the "main" program that
>created the original dataset (because I don't want all 2,000 numbers
>within that main program), but I do want to be able to call the program
>above from the main program and have the original dataset be returned
>minus the 2,000 observations with "bad" line numbers. Is it possible to
>call another program within a program
>like this??? Thanks in advance...


I don't think that having 2000 entries in an IN statement is a good way to
handle your problem. I agree with Richard. Keeping them in a different
data
set is a good way to make your system more maintainable, and easier to use
in another program.

In addition to Richard's idea, you could also consider putting your list in
a SAS
format. SAS will let you build formats from data sets (look at the CNTLIN
feature
of PROC FORMAT for more detail), and then you could call up your format
easily.

Also, is your variable LINE character or numeric? You have it set up for a
character variable in the IN statement, since you are testing it against
quoted
strings. If LINE is numeric, then you ought to drop all those quote marks
too.

HTH,
David
--
David L. Cassell
mathematical statistician
Design Pathways
3115 NW Norwood Pl.
Corvallis OR 97330

__________________________________________________ _______________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/g...ave/direct/01/
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: OT: Chance to Make SAS-L History: Did You Know That... Craig Stroup Newsgroup comp.soft-sys.sas 0 08-14-2007 08:05 PM
Re: a quicker way to create macro variables data _null_; Newsgroup comp.soft-sys.sas 0 06-06-2007 04:34 PM
proc report sas to excel: break not working Bob Sayre Newsgroup comp.soft-sys.sas 1 06-29-2006 04:50 PM
Re: Read/Write Microsoft Word document William W. Viergever Newsgroup comp.soft-sys.sas 0 05-31-2006 08:46 PM
Re: Read/Write Microsoft Word document Joe Whitehurst Newsgroup comp.soft-sys.sas 0 05-31-2006 08:35 PM



All times are GMT. The time now is 01:10 PM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.