[Info-vax] OpenVMS - DCL - Data entry filtering

David Froble davef at tsoft-inc.com
Fri Mar 27 17:59:11 EDT 2015


Stephen Hoffman wrote:
> On 2015-03-27 18:41:05 +0000, JF Mezei said:
> 
>> The text is free form so it often includes weird and funky characters 
>> so those strings need to be normalised so they can be included in a 
>> file name.
> 
> So you're working around the limitations of the particular local file 
> system?  You could pick a file system for suited to the task — VMS can 
> sort-of UTF-8 names, and other file systems on other platforms can 
> accept UTF-8 names much more directly — or you could create a class that 
> does the syntax processing for you.  Having a VMS call to process a 
> filename — somewhat akin to what a call such as LIB$TRIM_FILESPEC can 
> provide for trimming the name — would be nice, as that would avoid folks 
> making syntax mistakes.  But then there are other approaches — with a 
> fast full-text search tool and a mildly-competent database design for 
> the data and the page linkages (and probably the page revision history, 
> if you're also keeping that), who cares what the individual data blobs 
> are named?  It'd also be nice if VMS had file tagging, whether via ACE 
> or otherwise.  Attach your "special" tagging data there and maybe the 
> source URL and the date the data was acquired there, rather than 
> overloading the filename.  With a path to your metadata, all you 
> probably really care about with the filename is that it's unique, after 
> all.
> 
> 

So, you want a unique filename.  This should work in most cases ....

$ ! Get date in YYYY-MM-DD format
$
$ T = f$cvtime(f$time())
$
$ ! Now convert to YYYYMMDD format
$
$ YY = f$extract(0,4,T)
$ MM = f$extract(5,2,T)
$ DD = f$extract(8,2,T)
$ HH = f$extract(11,2,T)
$ NN = f$extract(14,2,T)
$ SS = f$extract(17,2,T)
$ XX = f$extract(20,2,T)
$
$ D = YY + MM + DD + HH + NN + SS + XX
$
$ write sys$output D



More information about the Info-vax mailing list