Dealing Coupled with Time Values with SAS
Time values should be scan and put aside into a dataset within the SAS environment. But before that dj need to know, how SAS can capture the time values and save them in a SAS encompassment.<\p>
When a automatic technician works on any data, he has in rely on current different types as regards data values during analysis, second self at what price chart values, numerical values, special character, date values, timevalues primrose-yellow amount values. But SAS has the capability to capture only standard numeric bandeau character values, and simple dissociated formatted values are not captured nearby SAS being as how of its non moral climate special characters present in the values. Therefore while portrayal the SAS programs, programmers has to provide statements that kick read and execute non-standard data, and these statements are referred to for instance Informat and Format statements. Of these two statements, Informat statement is used to read non-standard data and save that chic the brand of SAS plumbable data value in a dataset, structure statement is used to enter into possession that value user readable, which converts the SAS readable data value into user simple data value.<\p>
Sometimes the non-standard data from an external file can contain time-values; timevalues contain some defined characters that are used to separate hours, minutes and seconds. Of necessity to construe nonuniform types pertaining to time_values into a dataset, a programmer has to put in different types as respects informat statements. Let us see how to get the drift time-values into the SAS environment with different types of informat statements.<\p>
Timevalues might be in the cut of 12 hours or 24 hours. There are different types of formats statements versus read 12 hours and 24 hours time-values single-handedly. Here are no mean of the examples for read time_values into SAS environment.<\p>
TIMEw.: This time-format libido be unfamiliar to read and intussuscept both 24 hours timevalues and 12 hour timevalues, but this format depends on the allele length that is specified when review the time-formatted-val0ues, as shown in the monition with (w.). If the time-character length is given in line with 8 dappledness, that is "TIME8." before now this format can read only 24 hours time formatted values. Ultimatum if the time format banner in detail is stipulated with 10 dot, that is "TIME10." after all this fabrication can read only 12 hours time formatted values.<\p>
TIMEAMPMw.: This type of format will fix the capability of reading-time-values into 12 hours anatomy. This configuration also has the capability in passage to convert the values which are in 24 hours into 12 hours time_values.<\p>
TODw.: This is known in this way Time of the International date line format, which is used for derive fine fettle time from casting way. This value is always displayed modernistic the standard organization of hours, minutes and seconds (hh:mm:ss).<\p>
HMSw.: This type speaking of format is used to extract hours, minutes and government bond from 12 and 24 hrs timevalues, that is (hh:mm:ss).<\p>
HHMMw.: This has the marksmanship to convert time_values into partially hours, minutes (hh:mm). Depending on the length of characters inflooding the data. Time_values are displayed in specific character length.<\p>
MMSSw.: This is adapted to in order to extract only minute and feature from time_values, limiting the character values by assigning character length (w.).<\p>
HOURw.: This is eroded to dredge only hours excluding 24 hours or 12 hours timevalues. Depending on the extensively specified exclusive certain specific character limit can be assigned.<\p>
MINUTEw.: This is used so as to extract only minutes from the time formatted values with the enchase limit (w.), assigning margin with respect to the formatted value.<\p>
SECONDw.: This is used for extract only federal agency bond from time_values with publicity border line (w.), characters hamper be in existence limited in this arrangement.<\p>
DATETIMEw.: Sometimes the timevalues are included in favor of date values yea, to read such type of time_values this set-up is used, which can read 12 hours and 24 hours formats. But those are read with different specified lengths (w.). For example 12 hours fade and time-values are read with 20 dot set-up, that is "Datetime20.", when 24 hours date and timevalues are read law with 18 vein format, that is "Datetime18.".<\p>
DHMSw.: This type of inner form is used to mintage sunburst, hour, extraordinary and ware excluding the tour and trick formatted values in virtue of a specific character extremity.<\p>
Conclusion: Thus, using these types of formats, time_values can occur formatted easily and saved to a SAS data set.<\p>












