@Daily1 wrote:
data emp;
input EMPMO $ 1-4 ENAME $ 6-11 JOB $ 13-21 MGR $ HIREDATE $ SAL $ COMM DEPTNO;
datalines;
7369 SMITH CLERK 7902 17-Dec-80 800 20
7499 ALLEN SALESMAN 7698 20-Feb-81 1600 300 30
7521 WARD SALESMAN 7698 22-Feb-81 1250 500 30
7566 JONES MANAGER 7839 02-Apr-81 2975 20
7654 MARTIN SALESMAN 7698 28-Sep-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-May-81 2850 30
7782 CLARK MANAGER 7839 09-Jun-81 2450 10
7788 SCOTT ANALYST 7566 09-Dec-81 3000 20
7839 KING PRESIDENT 17-Nov-81 5000 10
7844 TURNER SALESMAN 7698 08-Sep-81 1500 30
7876 ADAMS CLERK 7788 12-Jan-83 1100 20
7900 JAME CLERK 7698 03-Dec-81 950 30
7902 FORD ANALYST 7566 03-Dec-81 3000 20
7934 MILLER CLERK 7782 23-Jan-82 1300 10
;
proc print;
run;
Please arrange the code
Please post code into a code box opened on the forum using either the {I} or "running man" icon as @PeterClemmensen did. The main message windows on this forum will reformat pasted text to remove white space and may introduce HTML characters that are not visible. This means that what you see in the window is very likely not what was actually in your editor.
Good idea to learn: Read date values into SAS date values not character. Almost any manipulation will require the conversion anyway so do it when reading. This may also give you warnings about bad date values like 31-Nov-16 that you can address earlier in your process. Note that when you sort character dates they will almost NEVER appear in the order you need and will not create graphs with the proper intervals.