Hi Xia. Here is the code being used: data RIS_BASE_MAMMO_ARRAY; FORMAT MRN $15. Ar_Accession1 - Ar_Accession&M_Accessions. $20. Ar_ExamCode1 - Ar_ExamCode&M_Accessions. $25. Ar_ReasonCode1 - Ar_ReasonCode&M_Accessions. $1. Ar_ExamClass1 - Ar_ExamClass&M_Accessions. $15. Ar_BIRADS1 - Ar_BIRADS&M_Accessions. $5. Ar_SignedByRAD1 - Ar_SignedByRAD&M_Accessions. $75. Ar_ScheduleDate1 - Ar_ScheduleDate&M_Accessions. DATETIME19. Ar_CompletedDate1 - Ar_CompletedDate&M_Accessions. DATETIME19. Ar_SignedDate1 - Ar_SignedDate&M_Accessions. DATETIME19. Ar_BTSd1 - Ar_BTSd&M_Accessions. 8. Ar_CTSm1 - Ar_CTSm&M_Accessions. 8. Ar_CTSd1 - Ar_CTSd&M_Accessions. 8. ; keep MRN Ar_Accession1 - Ar_Accession&M_Accessions. Ar_ExamCode1 - Ar_ExamCode&M_Accessions. Ar_ReasonCode1 - Ar_ReasonCode&M_Accessions. Ar_ExamClass1 - Ar_ExamClass&M_Accessions. Ar_BIRADS1 - Ar_BIRADS&M_Accessions. Ar_SignedByRAD1 - Ar_SignedByRAD&M_Accessions. Ar_ScheduleDate1 - Ar_ScheduleDate&M_Accessions. Ar_CompletedDate1 - Ar_CompletedDate&M_Accessions. Ar_SignedDate1 - Ar_SignedDate&M_Accessions. Ar_BTSd1 - Ar_BTSd&M_Accessions. Ar_CTSm1 - Ar_CTSm&M_Accessions. Ar_CTSd1 - Ar_CTSd&M_Accessions. ; Array AR_MRN_Char{6, &M_Accessions.} Ar_Accession1 - Ar_Accession&M_Accessions. Ar_ExamCode1 - Ar_ExamCode&M_Accessions. Ar_ReasonCode1 - Ar_ReasonCode&M_Accessions. Ar_ExamClass1 - Ar_ExamClass&M_Accessions. Ar_SignedByRAD1 - Ar_SignedByRAD&M_Accessions. Ar_BIRADS1 - Ar_BIRADS&M_Accessions. ; Array AR_MRN_Num{6, &M_Accessions.} Ar_ScheduleDate1 - Ar_ScheduleDate&M_Accessions. Ar_CompletedDate1 - Ar_CompletedDate&M_Accessions. Ar_SignedDate1 - Ar_SignedDate&M_Accessions. Ar_BTSd1 - Ar_BTSd&M_Accessions. Ar_CTSm1 - Ar_CTSm&M_Accessions. Ar_CTSd1 - Ar_CTSd&M_Accessions. ; do obs = 1 by 1 until (last.MRN); set RIS_BASE_MAMMO_DER_1; by MRN; Do j = 1 to 6; Select (j); when (1) do; AR_MRN_Char{j, obs} = Accession; end; when (2) do; AR_MRN_Char{j, obs} = ExamCode; end; when (3) do; AR_MRN_Char{j, obs} = Reason; end; when (4) do; AR_MRN_Char{j, obs} = MammoClass; end; when (5) do; AR_MRN_Char{j, obs} = SignedBy; end; when (6) do; AR_MRN_Char{j, obs} = AssessCode; end; otherwise; end; end; Do j = 1 to 6; Select (j); when (1) do; AR_MRN_Num{j, obs} = SchedDTTM; end; when (2) do; AR_MRN_Num{j, obs} = CompletedDTTM; end; when (3) do; AR_MRN_Num{j, obs} = SignedDTTM; end; when (4) do; AR_MRN_Num{j, obs} = BTSd; end; when (5) do; if not missing(SignedDTTM) then do; AR_MRN_Num{j, obs} = round(((SignedDTTM-CompletedDTTM)/3600)); /*Completed to Signed in minutes for ACR comparison*/; end; end; when (6) do; if not missing(SignedDTTM) then do; AR_MRN_Num{j, obs} = round(((SignedDTTM-CompletedDTTM)/86400)); /*Completed to Signed in days for charting */; end; end; otherwise; end; end; end; run; I think the obs Data Step variable could be used to somehow, but what that how would be is the question. The preferred layout would be MRN Accession1 ExamCode1 ReasonCode1 ExamClass1 BIRADS1 SignedByRAD1 ScheduledDate1 CompletedDate1 SignedDate1 BTSd1 CTMSm1 CTSd1 Accession2 (and all the _2 variable in the same order), etc. Your suggestion of using SQL with the Dictionary table is intriguing. Thanks for your contribution.
... View more