1753809 Members
8742 Online
108805 Solutions
New Discussion юеВ

DCL Com Procedure

 
SOLVED
Go to solution
Ian Derringer
Regular Advisor

DCL Com Procedure

Help! To make the long stoy short, I need to know how I can $extract the current system and concatenate with the name of the file within my VMS com procedure? I do know how to set the date, month, and year and extract from that, but not sure on how to get the current time.

Thank you in advance.

Ian
10 REPLIES 10
Karl Rohwedder
Honored Contributor

Re: DCL Com Procedure

Please have a look at the lexical functions F$TIME() and F$CVTIME(), e.g. F$CVTIME(,,"HOUR") gives the current hour etc.

regards Kalle
Hein van den Heuvel
Honored Contributor
Solution

Re: DCL Com Procedure


John,

Please reread your question and help us further understand what help you seek.
Give input and output examples as needed.
Show what works, what does not work.
Exact errors, code snippets, whatever is needed to clarify the problem please.
Attach in a text file if needed.

If you indeed want the current system time in a file name then check out something like this:

$ write sys$output f$cvtime()
2005-10-12 00:54:35.73
$
$ time = f$cvtime() -"-"-"-"-" "-":"-":"-"."
$ show symb time
TIME = "2005101200555386"
$ filename = "test" + time + ".txt"
$ show symbol filename
FILENAME = "test2005101200555386.txt"
$

The above 'subtracts' (removes) the punctuation chars (-- ::.) from the time string.

Check out HELP LEXI F$CVT to see how you can just get other selected fields for a certain time.

Check out HELP LEXI F$EXTR and F$SEGM to see how you can select a chunk of string.

Check out F$TIME() for a basic string with the current time.

Hope this helps some.
Hein.





John Gillings
Honored Contributor

Re: DCL Com Procedure

Ian,

>$extract the current system and concatenate with the name of the file within my VMS com procedure?

Not sure I understand your question.

F$GETSYI("NODENAME") returns the name of the system.

F$ENVIRONMENT("PROCEDURE") returns the name of the executing procedure

F$EXTRACT(pos,size,string) returns the substring of "string", "size" characters long starting at position "pos" (first character is position 0).

Hein has covered time strings (but I'm not sure what he's talking about "F$SEGM" - confusing DCL with BASIC?)
A crucible of informative mistakes
Hein van den Heuvel
Honored Contributor

Re: DCL Com Procedure

F$ELEMENT, didn't I say F$ELEMENT?

Hein :-)

Robert_Boyd
Respected Contributor

Re: DCL Com Procedure

Did you say something about the 5th Element?
;-)

Proost,

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Jan van den Ende
Honored Contributor

Re: DCL Com Procedure

The 5th element?
What is so special about Boron?
Is computers not mainly about Silicon?
(trace of the Chemical Engeneer of a former life)

Proost.

Have one on me.

jpe

Don't rust yours pelled jacker to fine doll missed aches.
Karl Rohwedder
Honored Contributor

Re: DCL Com Procedure

I think he refers to the hollywood movie 'the 5th element', wasn't it with Mel Gibson?

regards Kalle
David B Sneddon
Honored Contributor

Re: DCL Com Procedure

No, that would be Bruce Willis and Mila Jovovich and Gary Oldman etc.

Dave
Daniel Fernandez Illan
Trusted Contributor

Re: DCL Com Procedure

David
Form me, the "5th element" was Mila Jovovich, Bruce Willis was only a taxi driver ;-)
Saludos.
Daniel.