! CHANGES FROM DATE TYPE 6 TO A NUMBER                                        
LN   BTLDATE6                                                                 
     OPEN LINK BTLDATE6                                                       
     READ BTLDATE6 USING KEY "11111"  !read link using pre-defined key        
     LET A$ = DATE                    !let A$ equal the type 6 date           
                                      !which is stored as...                  
                                      !CHR(CC) + CHR(YY) + MMDD               
     LET B$=STR(ASC(A$(1,1)))         !let B$ equal string of CHR(CC)         
     LET C$=STR(ASC(A$(2,1)))         !let C$ equal string of CHR(YY)         
     LET D$=A$(3,4)                   !let D$ equal string of MMDD            
     IF LEN(C$)=1                     !test to see if C$ is a one digit       
        LET E$=B$+"0"+C$+D$           !if C$ is one digit, place the          
                                      !zero before it and add the string      
                                      !of each number                         
        LET E$=B$+C$+D$               !if C$ is not one digit, add the        
                                      !string of each number                  
     LET N = DTN(E$,"YYYYMMDD")       !gets the number from the string        
                                      !using the mask                         
     LET N$ = NTD(N,"YYYYMMDD")       !gets the date from the number          
                                      !using the mask                         
     PRINT N, N$                                                              
     INPUT *