Computing.Net > Forums > OpenVMS > automatically generating DCL scripts

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

automatically generating DCL scripts

Reply to Message Icon

Name: Roly Williams
Date: June 18, 2009 at 03:14:40 Pacific
OS: openVMS
Subcategory: Software Problems
Comment:

I have an application that outputs a file consisting of a list of files specs. For example:

DISK$TEST1:[INTH_TESTS.PAM.682.REPORTS.V12.SIGTRAN]PAM_19_1_021.REPORT;2
DISK$TEST1:[INTH_TESTS.PAM.682.REPORTS.V12.SIGTRAN]PAM_20_1_083.REPORT;2
DISK$TEST1:[INTH_TESTS.PAM.682.REPORTS.V12.SIGTRAN]PAM_25_1_024.REPORT;2
DISK$TEST1:[INTH_TESTS.PAM.682.REPORTS.V12.SIGTRAN]PAM_26_1_045.REPORT;1
DISK$TEST1:[INTH_TESTS.PAM.682.REPORTS.V12.SIGTRAN]PAM_26_1_046.REPORT;1
DISK$TEST1:[INTH_TESTS.PAM.682.REPORTS.V12.SIGTRAN]PAM_27_1_015.REPORT;1

I frequently have a need to convert this file into a DCL script of the form:

$@pam PAM_19_1_021
$@pam PAM_20_1_083
$@pam PAM_25_1_024
$@pam PAM_26_1_045
$@pam PAM_26_1_046
$@pam PAM_27_1_015

At the moment, I do this by opening the file in EVE and executing multiple REPLACE commands. This can be time consuming if the list is several hundred lines long and the number at the end of each line can take many different values. Is there a way to automate this conversion?



Sponsored Link
Ads by Google

Response Number 1
Name: Joseph.Huber
Date: June 18, 2009 at 06:24:47 Pacific
Reply:

Several possibilities:
(1) modify the application so that it outputs the second list together with the first.

(2) modify pam.com so that it accepts the full file specifications; then in eve it is an replace ALL of string "DISK$TEST1:" by " $@pam DISK$TEST1:"

(3) write a DCL command file which loops over the file list:
$open/read in listfile.lis
$open/write out scriptfile.com
$loop:
$read/end=done in file
$name=f$parse(file,,,"NAME","SYNTAX_ONLY")
$ write out "$@pam ",name
$ goto loop
$done:
$ close out
$ close in
$ exit

Joseph Huber, http://www.huber-joseph.de
ITRC


1

Response Number 2
Name: Roly Williams
Date: June 18, 2009 at 07:54:23 Pacific
Reply:

Thanks a million. Option 3 works perfectly.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: automatically generating DCL scripts

dcl script help www.computing.net/answers/openvms/dcl-script-help/334.html

DCL script for F$GETQUI needed www.computing.net/answers/openvms/dcl-script-for-fgetqui-needed/310.html

DCL script to check for empty file www.computing.net/answers/openvms/dcl-script-to-check-for-empty-file/296.html