Operating System - OpenVMS
1752630 Members
5614 Online
108788 Solutions
New Discussion юеВ

Re: OpenVMS - Small EVE program to run in BATCH

 
Edmundo T Rodriguez
Frequent Advisor

OpenVMS - Small EVE program to run in BATCH

Hello!

I haven't been sucsesfull in running the following EVE (EDIT/TPU) lines in BATCH.

I need to generate a small procedure to constanly perform such line because I almost
doing it INTERACTIVE on a daily basis.

See Attachment ...

----------------------------------------------
The main issue is that besides doing it daily it need to be done over 750 times.

Please, I only need the EVE lines (or EDT if possible)
6 REPLIES 6
RBrown_1
Trusted Contributor

Re: OpenVMS - Small EVE program to run in BATCH

It would take me a while to figure out what TPU to write to do this, but in EDT, it is quite short:

c;777(""pastevbl)ex
exit

Insert your search string in the "". Preloading your paste buffer is left as an exercise.

Put this in a file and then

$ EDIT/EDT targetfile/COMMAND=commandfile

Figuring out how to do it in batch is left as an exercise.
Hein van den Heuvel
Honored Contributor

Re: OpenVMS - Small EVE program to run in BATCH

Edmundo,

Please explain the exact text transformation you want to do.
There may be better (more robust) algoritms or tools. May we assume that the 777 is just a sufficiently large number to cover the whole file?
In fact you may want to explain 'the next step' to see if we can offer even better advice.
As in... what do exactly do you want to do, and why?

Cheers,
Hein
Bob Blunt
Respected Contributor

Re: OpenVMS - Small EVE program to run in BATCH

Edumundo, simple EVE/TPU work in batch is cake. We used this as part of the core of an application based on mail to receive a list of files, extract the various parts of the email message into discrete files and then automatically generate the outbound email message with the resulting data. There's only one problem... It'll be tomorrow before I can get to my examples/code that are in a BACKUP saveset.

EVE/TPU is easier because you can TELL it you have no terminal and do simple manipulation in batch. EDT can be a real pain when you try to trick it into working in batch. The key here is your work in TPU has to be pretty simple, search for this string, select that, cut, insert, etc.

bob
Robert Atkinson
Respected Contributor

Re: OpenVMS - Small EVE program to run in BATCH

Have a look at the attached file which runs with this command in a DCL batch file :-

$ DEFINE /USER SYS$INPUT SYS$COMMAND
$ EDIT /TPU /NOINIT /NODISPLAY /SEC=SYS$LIBRARY:SYS$TPUSECTION.TPU$SECTION -
/COMMAND=SY0:[LIVE.TXT]AMEND_HEADER_TPU.TXT SYS$TEMP:'SHORT'


Rob.
Kelly Stewart_1
Frequent Advisor

Re: OpenVMS - Small EVE program to run in BATCH

Edmundo,

A note on step 5, move to start of line - if it happens that the cursor is already at the start of the line, this will cause an error and abort the repeat sequence. When I make a macro like this I move the cursor one character to the right before entering Ctrl+H.

I also prefer to do the first Find manually (that is, before Learn), and put the Find for the next string at the end of the macro as a repeat (Find Find). This allows me to use the macro for different search strings, and when running it interactively, view the text it's about to operate on. The downside of course is I can't always see what it just did.

You may want to save this macro in your TPU section file so you don't have to re-Learn it each time.
Bob Blunt
Respected Contributor

Re: OpenVMS - Small EVE program to run in BATCH

Sorry for the delay, Edmundo. Here's an example that takes an output file from VMSmail, searches for "subj:" and saves the sender and receiver's email address into a separate file. ITRC will only allow one attachment so the command I use in a command procedure submitted to batch is attached (named .txt to keep winders happy) and the TPU script is listed below. In the command procedure I call the TPU script save_tofrom.tpu:

set cursor bound
set noexit attribute check
find subj:
start of line
select
bottom
remove
exit

It's just a simple example. Check TPU documentation for other commands you can use and their structure.