BookmarkSubscribeRSS Feed
noda6003
Quartz | Level 8

I have a dataset which has grades and variable named chk. what i want it from is to get grades which are more than the one initially i.e chk gt 0

 


DATA work.check;
    LENGTH
        ID                 8
        grade              8
        chk                8 ;
    FORMAT
        ID               BEST12.
        grade            BEST12.
        chk              BEST12. ;
    INFORMAT
        ID               BEST12.
        grade            BEST12.
        chk              BEST12. ;
    INFILE DATALINES4
        DLM='7F'x
        MISSOVER
        DSD ;
    INPUT
        ID               : BEST32.
        grade            : BEST32.
        chk              : BEST32. ;
DATALINES4;
110
110
121
220
221
211
211
320
310
331
;;;;



something like this since ID 1 has more grade than it has in chk=0 and ID=3 has grade=3 which is more than in chk=0.

ID grade chk
1 2 1
3 3 1

Not sure how to do it programmatically. Any help

1 REPLY 1

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 705 views
  • 0 likes
  • 2 in conversation