help with basic conversion concepts in SAS

#1
I have been reading around but I still do not understand on how to convert characters/numbers/dates and in their different formats. I'm confused when to use puts, inputs and formats.

suppose I have a date variable: x = 2016Dec01.
if I want to convert it to 20161201, is my syntax: put(x,yymmn8.)? if I want it to be 12-01-2016, is it put(x,mmddyy8.) when do I use inputs and when do I use puts? I've seen some code, where it's input(put(x,yymmn6.),6.), but I do not know why they combined puts and inputs, and I do not understand what the last 6. is for.