This seems to work:
data example;
infile datalines;
input lastname :$10. firstname :$10.
/ deptid
/salary :comma10.
;
lastname = compress(lastname,',');
format salary comma12.2;
datalines;
Jadhav, Rakesh 1234
123 Sales
43,696.78
Bhate, Sameer 1240
132 Sales
45,099.50
Rane, Dipak 1252
133 SALES
47,098.71
Patil, Chetan 1424
105 Marketing
17,098.71
Khan, Salama 1366
122 Publications
29,996.63
;
You would use an INFILE statement that points to your file and not include the DATALINES. You may want different informats for the names if you have longer actual names. This likely won't work for names with 3 or more parts.
The / in the INPUT statement basically says "read from next line".
If any of your data per person is more or less than 3 lines then this also will fail because it doesn't match the example shown.
You did not indicate whether the deptid should be character or numeric.
... View more