|     |     |
| --- | --- |
| 1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>11<br>12<br>13<br>14<br>15<br>16<br>17<br>18<br>19<br>20<br>21<br>22<br>23<br>24<br>25<br>26<br>27<br>28<br>29<br>30<br>31<br>32<br>33<br>34 | `/``*`<br>`Chapter``3`<br>`Question``10``: Stock Stock symbol``1``4``Char`<br>`PurDate Purchase date``5``10``mm``/``dd``/``yyyy`<br>`PurPrice Purchase price``15``6``Dollar signs``and`<br>`commas`<br>`Number Number of shares``21``4``Num`<br>`SellDate Selling date``25``10``mm``/``dd``/``yyyy`<br>`SellPrice Selling price``35``6``Dollar signs``and`<br>`commas`<br>`Author Name : Shruti Goyal`<br>`*``/`<br>`data stocks1;`<br>`infile``'d:\sas\stockprices.txt'``dsd;`<br>`input``@``1``Stock                   $``4.`<br>```@5``PurDate          mmddyy10.`<br>```@15``PurPrice      dollar6.`<br>```@21``Number``4.`<br>```@25``SellDate           mmddyy10.`<br>```@35``SellPrice       dollar6.`<br>```;`<br>```TotalPur``=``Number``*``PurPrice;`<br>```TotalSell``=``Number``*``SellPrice;`<br>```Prfit``=``TotalSell``-``TotalPur;`<br>`run;`<br>`title``'Old format display'``;`<br>`proc``print``data``=``stocks1;`<br>`Format``PurDate date9.`<br>```SellDate date6.`<br>```SellPrice dollar6.`<br>```PurPrice dollar6.`<br>```Profit dollar7.`2``;`<br>`run;` |

### Rate this:

i

Rate This

### Share this:

- Facebook

- [Share on WhatsApp (Opens in new window)WhatsApp](/content/2016/10/01/converting-date-price-format-in-sas/?share=jetpack-whatsapp&nb=1/index.html)
