I have a SAS data set (grouped by ID, Sub\_ID Ordered By ID) say as follows,

```
ID        Sub_ID      Field_1         Field_2
1            4           4               8
1            5           9               5A

```

Desired Output (No Sub\_ID required in Output Dataset):

```
ID        Field_1         Field_2
1            4               5A

```

What I want to do?

I need a single row output for each ID where value of Field\_1 should be same as it was for the first occurence of that particular ID, while Field\_2 should be same as it was for the last occurence of the particular ID.

If I use First.ID, output is

```
ID        Field_1         Field_2
1            4               8

```

And if I use Last.ID, output is

```
ID        Field_1         Field_2
1            9               5A

```

I am not sure how to combine these two conditions.