You will want to first begin using SAS numeric variables for DATE, TIME and DATETIME strings. It can be done at INPUT time or with a SAS assignment statement, using the INPUT function and the appropriate INFORMAT.
Let's take a step back and consider this "fake" data:
In the above "fake" data:
-- the first variable occupies positions 1-8 on the data line and is a character string of 8 bytes
-- the second variable, a date, occupies positions 9-18 on the data line and is a date value of the form mmddyy which takes 10 bytes on the data line
-- the third variable, a time value occupies positions 19-26, and is a time value of the form hh:mm:ss, which takes 8 bytes on the data line
It is appropriate, as Scott explained, to read the second and third variables into numeric SAS variables, which means the use of an INFORMAT in the INPUT statement. Since these "fake" data rows are all "lined up" (meaning every data value starts in the same position). I would use COLUMN INPUT with an INFORMAT to read the second and third variables. I do not believe you can read from position 9-26 with any existing INFORMAT (such as ANYDTDTM) in order to make a DATETIME numeric variable, because there is no delimiter between the date value and the time value. The documentation for ANYDTDTM is here: http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a002605552.htm
This program illustrates how you can write a test program in order to read the "fake" data values and verify that your INPUT statement is reading the input data correctly. The "DATALINES" section shows the "fake" data and INFILE DATALINES statement points to the bottom of the program as the place for SAS to read the data -- this program illustrates COLUMN INPUT with an INFORMAT to read DATE_VAR and TIME_VAR as numeric variables and then uses the DHMS function to create a DATE/TIME variable from your numeric variables. If you run the program, read the documentation and carefully examine the output, it might help you figure out how to fix your code and read your data correctly:
Input @1 Char_var $8.
@9 Date_var mmddyy10.
@19 Time_var time8.;
dtvar = dhms(Date_var,0,0,Time_var);
format Date_var mmddyy10. Time_var time8. dtvar Datetime.;
proc print data=testinput;
title 'testinput dataset with formats applied';
Scott already suggested that it would be better to read the 2 variables as numeric values and if you did this, you would not have to use the DATEPART and TIMEPART functions at all. Nor would you have to create DateTimeofSale by concatenating character strings and hoping that the concatenation would result in a numeric date/time value.
In several of your posts, you created the file PERIOD1 and in the program (posted with the error), you are creating the dataset RESULT from PERIOD1. There's no real reason to create RESULT in a separate DATA step program because it seems the only purpose of the RESULT file is to correct data problems that existed because of the issues noted in the creation of the PERIOD1 dataset.
It always helps if you post an example of your data (a few lines) and your WHOLE code and your LOG to give folks as much information as possible to help you. If you read the documentation, as suggested, and there's something you do not understand, then it would be better to ask about what you do not understand than to post code which makes it look like you are ignoring suggestions that have already been made.
For more information about how to post code (and perhaps a data sample to the forum), this previous posting talks about the use of [pre] and [/pre] to maintain code indenting and to post samples of data that will line up. http://support.sas.com/forums/thread.jspa?threadID=7550