What is a DCL procedure?
Often the same series of DCL commands need to be issued many times, or some action needs to be automated. By placing a series of DCL commands in a file these goals can be attained. DCL supports control logic (IF, GOTO, CALL, etc.) so that quite complicated programs can be written in it, if need be. Examples DCL procedure (finds all organization:sequential files in a directory – not a terribly useful thing to do!): $!first line of DCL procedure: search_example.com $!P1 is a search string $ if(P1 .nes. “”) $ then $ string = P1 $ else $ string = “*.*” $ endif $top: $ file = f$search(string) $ if (file .eqs. “”)then exit $ org = f$file_attributes(file,”ORG”) $ if (org .eqs. “SEQ”)then write sys$output file $ goto top $!last line of DCL procedure $ @SEARCH_EXAMPLE Default, look at everything in local directory $ @SEARCH_EXAMPLE [.SUBDIR]*.TXT Look where indicated $ SUBMIT/LOG=SYS$LOGIN:/NOPRINT/AFTER=20:00 SEARCH_EXAMPLE Default, but do in batch, after 8:00 PM $ SUBMIT/LOG=SYS$LOGIN:/NOPRIN