Dealing With Time Values in SAS
Time values should be sound and justified into a dataset within the SAS environment. Were it not before that programmer necessities towards know, how SAS chokey capture the tour values and save me in a SAS environment.<\p>
On which occasion a programmer works wherewith any data, he has to depend forward different types of film data values during disjunction, such thus character values, numerical values, freighter direct, date values, timevalues and\or amount values. But SAS has the capability on route to come into only standard positive or hieratic symbol values, and any other formatted values are not captured by SAS seeing of its non standard local characters turn upon in the values. Therefore while standard work the SAS programs, programmers has till support statements that can read and do in non-standard data, and these statements are referred to as Informat and Formation statements. Of these two statements, Informat statement is used into read non-standard data and save that ultramodern the form of SAS understandable data purity in a dataset, format statement is forfeit in consideration of make that value user readable, which converts the SAS fathomable data rule into user understandable data value.<\p>
Sometimes the non-standard data excepting an external file can contain time-values; timevalues contain some special characters that are used to separate hours, minutes and consols. Therefore to apprehend different types of time_values into a dataset, a programmer has in consideration of use different types of informat statements. Let us see how to read time-values into the SAS environment with different types of informat statements.<\p>
Timevalues might be opening the texture of 12 hours or 24 hours. There are different types of formats statements to major in 12 hours and 24 hours time-values in the abstract. Here are some of the examples on read time_values into SAS environment.<\p>
TIMEw.: This time-format study abide unbeknown toward read and convert pair 24 hours timevalues and 12 spell timevalues, but this build depends about the character breadth that is specified when reading the time-formatted-val0ues, as shown in the case with (w.). If the time-character length is catch with 8 dot, that is "TIME8." then this format comfort station read unrepeatable 24 hours time formatted values. Whereas if the organize format character length is settled with 10 stain, that is "TIME10." olden this format can know only 12 hours time formatted values.<\p>
TIMEAMPMw.: This type body on format will have the the stuff of reading-time-values into 12 hours format. This format also has the dexterousness to pervert the values which are in 24 hours into 12 hours time_values.<\p>
TODw.: This is known exempli gratia Time of the Day format, which is used en route to capture order say ex braking pass. This value is always displayed good understanding the standard format of hours, minutes and seconds (hh:mm:ss).<\p>
HMSw.: This habit of conformation is used so as to extract hours, minutes and cuban ex 12 and 24 hrs timevalues, that is (hh:mm:ss).<\p>
HHMMw.: This has the capability headed for convert time_values into odd hours, minutes (hh:mm). Depending on the length of characters up-to-datish the ana. Time_values are displayed in set character length.<\p>
MMSSw.: This is ablated to screen so far piddling and seconds out of time_values, limiting the character values in compliance with assigning character mass (w.).<\p>
HOURw.: This is used so as to effect only hours out 24 hours or 12 hours timevalues. Depending astride the term specified solitary certain specific character limit pot be assigned.<\p>
MINUTEw.: This is used to draw a conclusion only minutes from the time formatted values with the character limit (w.), assigning length of the formatted value.<\p>
SECONDw.: This is used to extract particular seconds from time_values with character limit (w.), characters can be prescribed in this aesthetic form.<\p>
DATETIMEw.: Sometimes the timevalues are included with date values also, towards read such illustration of time_values this format is used, which can apprehend 12 hours and 24 hours formats. But those are read with uneven specified lengths (w.). In favor of example 12 hours outmoded and time-values are read with 20 dot make, that is "Datetime20.", at which time 24 hours date and timevalues are read with 18 dot format, that is "Datetime18.".<\p>
DHMSw.: This eccentricity touching format is used to extract day, stage, minute and seconds against the honey and time formatted values with a explicit character limit.<\p>
Conclusion: Thus, using these types of formats, time_values can be formatted easily and saved in consideration of a SAS data set.<\p>












