From: MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 8-JUL-1992 20:43:45.75 To: DWING@UH01.Colorado.EDU CC: info-vax@sri.com, tillman@swdev.si.com Subj: Re: Utility for chronological directory in DCL? Dan Wing (DWING@UH01.Colorado.EDU) writes: >You wrote: > >>You can get the DIRECTORY command to put out the date and time in the format >>you want using the LIB$DT_FORMAT logical names. > >I tried a few different combinations. Could you send some examples? In order to make use of the LIB$DT* formats, first one must enable LIB$DT* support on one's VAX. To do this, put the following in SYS$SYSTARTUP_V5.COM: $ @sys$startup:lib$dt_startup This requires SYSNAM, SYSPRV, and CMEXEC privileges. Alternatively, one can do the following: $ sysman startup add file lib$dt_startup.com This creates the logical name table LNM$DT_FORMAT_TABLE and defines logical names in that table of the form LIB$DATE_FORMAT_xxx and LIB$TIME_FORMAT_xxx. These logical names are somewhat equivalent to FAO control strings, although they are different. In any event, this allows each person on the VAX to define the logical name LIB$DT_FORMAT as a search list of one LIB$DATE_FORMAT_xxx and one LIB$TIME_FORMAT_xxx name. The default is: $ sho log lib$dt_format "LIB$DT_FORMAT" = "LIB$DATE_FORMAT_001" (LNM$SYSTEM_TABLE) = "LIB$TIME_FORMAT_001" $ sho log/table=lnm$dt_format_table lib$date_format_001 "LIB$DATE_FORMAT_001" = "!DB-!MAAU-!Y4" (LNM$DT_FORMAT_TABLE) $ sho log/table=lnm$dt_format_table lib$time_format_001 "LIB$TIME_FORMAT_001" = "!H04:!M0:!S0.!C2" (LNM$DT_FORMAT_TABLE) Notice that the date format says "!DB-!MAAU-!Y4" The "!DB" means "day, blank filled". The "!MAAU" means "month, ASCII, abbreviated, upper case", and the "!Y4" means "year, four digits". Each field is separated by a hyphen. The time format is similar. The "!H04" means "hours, zero filled, 24 hour format", the "!M0" means "minutes, zero filled", the "!S0" means "seconds, zero filled", and the "!C2" means "hundredths, two digits". The hours, minutes, and seconds are separated by colons, and the fraction is separated from the seconds by a period. Putting this all together gives the standard DIRECTORY command's date and time display; i.e. $ dir/dat login.com Directory MY_DISK:[MYDIR] LOGIN.COM;63 8-JUL-1992 08:27:47.38 Total of 1 file. If you want to change the display and use, say, comparison date format (to make sorting easy), try defining LIB$DT_FORMAT as follows: $ define lib$dt_format lib$date_format_037, lib$time_format_001 Now when you do your DIRECTORY command, you see: $ dir/dat login.com Directory MY_DISK:[MYDIR] LOGIN.COM;63 1992-07-08 08:27:47.38 Total of 1 file. Now you can do the following: $ dir/out=dirlist/nohead/notrail/dat/wid=(disp=80,fil=56) .dat $ sort/key=(pos=59,siz=22) dirlist.lis dirlist.lis and have a directory listing in chronological order by creation date. You can also change the language of the display. If, for example, you like French, you can: $ define sys$language french $ define lib$dt_format lib$date_format_002,lib$time_format_001 and you get: $ dir/dat login.com Directory MY_DISK:[MYDIR] LOGIN.COM;63 8 juillet 1992 08:27:47.38 Total of 1 file. Any questions? -----------------------------+-------------------------------- Brian Tillman | Internet: tillman@swdev.si.com Smiths Industries, Inc. | 4141 Eastern Ave. MS129 | Hey, I said this stuff myself. Grand Rapids, MI 49518-8727 | My company has no part in it. -----------------------------+--------------------------------