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

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 04-13-2006, 12:55 PM
nospam@HOWLES.COM (Howard Schreier
Guest
 
Posts: n/a
Default Re: ADDING ROWS FOR MISSING ORDER VARIABLES

1. Using PROC SQL or PROC SORT, create a list of the unique ORD1 values.

2. Create a table containing all of the possible ORD2/LABEL1 pairs, with
zeroes for TRT1.

3. Using PROC SQL, join #1 and #2.

4. Code a DATA step with an UPDATE statement. Use #3 as the master, WONG
as the transaction data set, and ORD1 and ORD2 as the BY variables.

On Wed, 12 Apr 2006 14:09:44 -0400, Rathindronath <mehedisas@YAHOO.COM>
wrote:

>I have a following dataset named WONG:
>
>ORD1 ORD2 LABEL1 TRT1
> 2 1 Safety Population 44(100.0)
> 2 2 10-17 years 1(2.3)
>
>I should have Value 1, 2, 3 & 4 for the variable ORD2. So I need to check
>first if ORD2 variable has all the four required value if it doesn’t (like
>the WONG dataset above) then there should be 2 ( depending how many values
>are missing: it can be 1 or 2 or 3 or even all of them) more row added
>with value 3 and 4 for ORD2 variable.
>After checking the values for ORD2 variable and adding the rows, WONG
>dataset should be all below:
>
>
>ORD1 ORD2 LABEL1 TRT1
> 2 1 Safety Population 44(100.0)
> 2 2 10-17 years 1( 2.3)
> 2 3 17-64 years 0( 0.0)
> 2 4 64-85 years 0( 0.0)
>
>Thanks in advance for your kind help.

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: Output the Results of a Proc Freq To A SAS Dataset Ian Whitlock Newsgroup comp.soft-sys.sas 1 12-30-2008 10:17 AM
GROUP or ORDER variables ERROR gscsrc@hotmail.com Newsgroup comp.soft-sys.sas 0 05-15-2007 12:24 PM
Re: ADDING ROWS FOR MISSING ORDER VARIABLES Jiann-Shiun Huang Newsgroup comp.soft-sys.sas 0 04-12-2006 09:44 PM
Re: Order of FIRST. / LAST. variables in PDV Venky Chakravarthy Newsgroup comp.soft-sys.sas 0 12-24-2004 01:03 PM
Re: Order of FIRST. / LAST. variables in PDV Jack Hamilton Newsgroup comp.soft-sys.sas 0 12-23-2004 09:21 PM



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


Copyright ©2009

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