Using the write_now ~output feature

Write_now, ~output option

The write_now ~output option causes the output file to be written out immediately, without calling any proc in an execute block.

With this operator, the ~translate command is obsolete. Attempts to use the ~translate operator will continue tofunction, but will generate a warning indicating that this operator is being phased out.

The ~input and ~output operators have all of the options necessary to read in and write out data files of any format and size that one is
likely to need. To use the write_now keyword, a simple spec with an appropriate ~input and ~output statement is needed and include the write_nowoption on the ~output statement.

This is of particular importance to Survent only clients who have no Mentor access keys. Mentor only checks for a key during ~execute blocks.Therefore, the write_now keyword allows Survent clients to translate and change the size of their data files without having a Mentor key.

NOTE: When the write_now option is used, neither the input nor the output files that were used are closed until a new input oroutput statement sppears in the run. Thus if the proc named “write” below contained a writecase statement, and one were to spec:

~input filein~output fileout write_now~exc proc=write

The records written out by executing proc=write will be APPENDED to the open output file. If you do not want this, useeither a blank ~output or restart the ~input file.

Example spec:

~comment&writenow.doc~defproc={proc1:m [1.50$]="This was changed by proc1"writecase}proc={display: print "s" [1.50$L] }~input $~output writenow write_now~input writenow.asc ascii=80~output writenow write_now~input writenow total_length=100~output writenow dta_format write_now~exc proc=proc1~input writenow dta_format~exc proc=display~end