Thank you very much. It seems to have worked but has thrown up another error now from the following code: proc sort data=bed1 nodupkey dupout=mult out=newbed; by pid noon; run; It gives: Syntax error, expecting one of the following: ;, (, ASCII, BUFFNO, DANISH, DATA, DATECOPY, DETAILS, DIAG, EBCDIC, EQUALS, FINNISH, FORCE, IN, ISA, L, LEAVE, LIST, MESSAGE, MSG, NATIONAL, NODUP, NODUPKEY, NODUPKEYS, NODUPLICATE, NODUPLICATES, NODUPREC, NODUPRECS, NODUPS, NOEQUALS, NORWEGIAN, NOTHREADS, OSA, OUT, PAGESIZE, PSIZE, REVERSE, SIZE, SORTSEQ, SORTSIZE, SORTWKNO, SWEDISH, T, TAGSORT, TECH, TECHNIQUE, TESTHSI, THREADS, WKNO, WORKNO. ERROR 76-322: Syntax error, statement will be ignored. I have checked online but it seems that this statement is written correctly. Could you give any suggestions as to what I am missing please? Sorry to ask another question. Thanks Mel
... View more