help reformat data with awk

I am trying to write an awk program to reformat a data table and convert the date to julian time. I have all the individual steps working, but I am having some issues joing them into one program. Can anyone help me out? Here is my code so far:

# This is an awk program to convert the dates from time series data to Julian dates.
#
#  1. Remove leading "1" from every line
#
{sub(1,"",$1); #print}
#
# 2. Change single digit months to MM
#
 sub(/^[ \t]+/,0); #print}  #### works up to here if i comment everything following out ####
#
# 3. Change single digit days to DD
#
 if ( NF == 37 ) sub(/^[ \t]+/,0,2); #print}
 else if ( NF == 38 ) sub(/^[ \t]+/,0,2) && sub(/^[ \t]+/,0,3); 
 print}   ### This is what I can't get working so far ###
#

Here is an example of the date part of the data:

110/24/74FDUNC
110/24/74FDUNC
110/25/74FDUNC
1 3/ 3/75FDUNC
1 3/ 3/75FDUNC
1 3/ 3/75FDUNC

step one as it says in the code removes the leading "1", step 2 adds a "0" to the single digit months and step 3 is suppose to add a "0" before the single digit days and years.
Right now I can get step 1 and 2 to run together, but I can't get step 3 to do anything. There are more steps after this, but not much use trying to get them to work until I get the first stuff to work. Thanks in advance.

You could use the printf format %02d to pad your single digits with 0.

If your (g)awk version supports the FIELDWIDTHS variable:

BEGIN {FIELDWIDTHS = "1 2 1 2 1 2 1 "}
{printf "%02d %02d %02d\n", $2, $4, $6}

If not:

{
        mm=substr($0, 2, 2); dd=substr($0, 5, 2); yy=substr($0, 8, 2)
        printf "%02d %02d %02d\n", mm, dd,  yy
}

Thanks for the reply. I actually figured out another way to make it work. Now if I could figure out why another step is adding a 0 before every row.

If you are using awk, just concatenate a 0 in front of your print or printf awk instruction.

(...)
    print "0" $1, $2, etc...
(...)
    printf "0%s %s", $1, $2

Thanks again ripat. Everything works smoothly now pending writing up the formula to convert to julian time and add that as the first column which should be easy.