LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 1997, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 14 Mar 1997 03:55:56 GMT
Reply-To:     lpogoda@AOL.COM
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         lpogoda@AOL.COM
Organization: AOL http://www.aol.com
Subject:      Re: (no subject given)

In article <85256458.00518A43.00@njros1ngw04.metro.prudential.com>, David Heck <david.heck@PRUDENTIAL.COM> writes:

>I have a small question, I set up a table that was created in a previous >step. I want to read the next file and select off policies only if they >have a matching policy number off the table. It works well , to a point. If >there are any duplicate policies on the new file I'm reading( and there >usually are) I miss the second one, because they are sorted by policy >number. What am I doing wrong and is there a better way to do this? >Here is the code I'm trying to use. For each policy number there can be up >to 5 logmsg fields. I'm writing out a fixed length record for each message >and moving on to the next one. When I hit the same policy number two times >(or more) in a row, it will only catch the first one.

A real kludge would be to use a dummy key value between each real lookup, that way you'd never be looking for the same policy number two or more times in a row. (That particular "solution" was actually suggested to me by SAS technical support when I called for advice in a similar situation.)

Really though, I think you need to rethink your logic. You have an observation, you've looked up your policy number. Then you have another observation and the policy number on this second observation is identical to the one you just looked up. Why would you want to look it up again? You already know what you'll find, or you will if you redo your logic. Something along the lines of

IF POLNUM ^= LAG(POLNUM) THEN SET NEXTC.IF952C KEY = POLNUM;


Back to: Top of message | Previous page | Main SAS-L page