Examples of $ZPARSE()

Example:

    
    GTM> WRITE $ZPARSE("TEST","",";3","DUST.LIS")
    SYS$:[THOMPSON.WORK]TEST.LIS;3
    GTM>
    
            
    

This uses $ZPARSE() to demonstrate defaulting using the third and fourth arguments. The result gets the device and directory field from the process current default directory, the name from the first expression, the type from the fourth extension, and the version from the third expression, .

    $ SET DEF[WORK.NEW]
    $ GTM
    GTM>WRITE $ZPARSE("TEST","","X.LIS","Y.C")
    USER:[WORK.NEW]TEST.LIS;
    GTM>WRITE $ZPARSE("test","","[WORK.NEW]","Y.C")
    USER:[WORK.NEW]TEST.C;
    GTM>        
    

This example illustrates the use of the third and fourth arguments to $ZPARSE(). In the first statement, the first argument has no directory or extension fields, so $ZPARSE() substitutes the extension field from the third argument. Since neither the third nor fourth argument specifies a directory, $ZPARSE() substitutes the current working directory, and because the fourth argument does not contain any fields that are not present in the third argument, the fourth argument is not used.

In the second statement, the first argument to $ZPARSE() is again missing both the directory and extension. In this instance, $ZPARSE() uses the directory specified in the third argument and, because neither the first nor third argument specifies a file extension, $ZPARSE() uses the file extension from the fourth argument.

    GTM> W $ZPARSE("GTM$DIST","DIRECTORY","","","NO_CONCEAL")
    [SYS1.SYSCOMMON.][GTM_DIST]
    GTM>
    

This uses $ZPARSE() to display the directory structure for the logical name GTM$DIST. The "NO_CONCEAL" keyword in the fifth argument causes the function to return information about the concealed logical name SYS$COMMON. Note the top level system directory may be different on your system and other parts of the path may vary if your shop uses a non-standard GT.M installation.