On 4/10/2015 4:25 AM, Paul Bailey wrote:
Does anyone have any ideas that could make RDi user's lives easier that might be possible using an Eclipse script?
I just wrote a Rexx macro for Code/400 to automate something that will
make my life easier. I have a very old application that has a few dozen
RPG programs creating work files from various mater files and
transaction files in order to create more work files and it's quite a
mess. I don't have a dedicated test environment so I need to make one.
Generally speaking, I'll CPYF from production to the test library and
off I'll go. How do I know what files I need? They're in the
F-specifications.
So I wrote a quick Rexx macro that reads the F-specs and creates CPYF
commands out of them. Because I can't do it inEclipse, I need to
copy/paste between RDi and Code, but it was so easy to write the Rexx
script that I'll take that pain. This is a quick, quick hack. No error
checking or anything. Took 5 minutes.
The point isn't to make my life easier with RDi per se, but to command
the editor to do things I might otherwise use awk and sed to do.
/* Convert F spec to CPYF */
fromlib = "production"
tolib = "buck00001"
/* how many lines? */
'extract elements'
/* move to first line */
top
i = 0
do until i >= elements
/* read the line */
'extract content'
/* file name */
filename = substr(content, 7, 8)
'insert cpyf 'fromlib'/'filename' 'tolib'/'filename' mbropt(*replace)'
/* delete the F spec and move to the next one, skipping over the cpyf */
i = i + 1
'prev'
'delete'
'next'
end
As an Amazon Associate we earn from qualifying purchases.