0

My data is in below form

account_no  transaction_start_dt_tm       RECTYPE   
34842765    23APR2017:14:34:00.000000        ICU      
34842765    25APR2017:17:26:00.000000        ICU      
34842765    28APR2017:14:18:00.000000        LLOC     

I want to enumerate rectype within the group that includes both account_no AND transaction_start_dt_tm. Account_no is constant, but transaction_start_dt_tm never repeats and Rectype has values of (ICU, LLOC). I want my output to be as shown below.

account_no  transaction_start_dt_tm       RECTYPE   RECNO_1 CNT
34842765    23APR2017:14:34:00.000000        ICU       1    1
34842765    25APR2017:17:26:00.000000        ICU       2    2
34842765    28APR2017:14:18:00.000000        LLOC      3    1
Kiran
  • 3,255
  • 3
  • 14
  • 21
A. MATULA
  • 31
  • 1
  • 7
  • can you show us by sample data you starting point from where you want the output – Kiran Oct 11 '18 at 19:32
  • account_no transaction_start_dt_tm RECTYPE CNT 34842765 23APR2017:14:34:00.000000 ICU 1 34842765 25APR2017:17:26:00.000000 ICU 2 34842765 28APR2017:14:18:00.000000 LLOC 1 – A. MATULA Oct 11 '18 at 19:50
  • so you want only RECNO_1 column, i mean that us tge new column, so do you have already cnt column – Kiran Oct 11 '18 at 19:52
  • For each account_no, everytime there is a change in RECTYPE I want it to enumerate. BUT it has to stay in transaction_start_dt_tm order – A. MATULA Oct 11 '18 at 19:58
  • I resolved my problem by including the NOTSORTED in my BY statement in my datastep and only include ACCOUNT_NO AND RECTYPE – A. MATULA Oct 11 '18 at 21:23
  • you can write your solution as answer – Kiran Oct 11 '18 at 21:26

0 Answers0