Learning SAS? Welcome to the exclusive online community for all SAS learners.

help to write sas program

Reply
Occasional Contributor
Posts: 12

help to write sas program

I am Creating a table such as student name, class ,roll no

roll no is set as identity,information of student is being saved in on table such as student name,class,roll no

i want such that

Student Name    Class   Roll No

   Snehal         1      1

    Alok          1      2

   Sandeep        1      3

  Swapnil         1      4

   Kunal          1      5

   Amit           1      6

  Nitin           2      1

Sudhanshu        2      2

  Lokesh          1      7

  Swati           2      3

  Rajesh          1      8

roll no is identity i want that roll no should change when class changes it should start with 1 when no records further added belongs to that class or if further records belongs to that class are added then it should continue from the last number

Please guide to write a sas program for  this where the roll number increments accordingly to the class

Super User
Super User
Posts: 7,401

Re: help to write sas program

Looks like a course question.  Have a read on - sorting data, and retain.

Ask a Question
Discussion stats
  • 1 reply
  • 275 views
  • 0 likes
  • 2 in conversation