× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



(I used to write ReXX macros under MVS and never understood why
midrange systems couldn't do that.)

Okay, I gotta ask... Why can't SEU do that? I.e., what "macros" would you like in SEU that can't be done with ReXX? (Not that anyone would _want_ to.)

Here's an example I wanted to use yesterday.  I'm fiddling with a
CPYFRMIMPF, and I have DDS that has numeric fields in it.  That DDS also
specifies EDTCDE(whatever).  For my tinkering purposes, I need another
version of that file's DDS where every field is character.

I can pretty easily change out all the spots that say '5p 0' or '10s 0',
making them '5a  ' and '10a  ', but I can't readily delete the lines
that say EDTCDE(whatever).  I say 'pretty easily' although it takes
several passes to change P to A and S to A, restricting by column and
remembering to hide comment lines <g>.

A ReXX macro does all of that in one pass.  Now, as the 'real' DDS
changes (new fields, different sizes and such), I run my macro over it
to translate it into the version that's character-only.

Since this is the WDSC list, discussion of how to do this in SEU is better in Midrange_L. But because it started with an idea like "WDSC can do it but SEU can't", I have to say at least that I don't see why this can't be implemented as a user-defined line command in SEU. (Maybe semantically that means it's not a 'macro'?)

You are right: this particular issue _can_ be implemented as a line command. It can also be written as a complete stand-alone program, and if I were marginally clever I could probably hack up a QSH script using grep and sed to do it, too. For me, the difference between any of these sorts of tools and an editor macro is the ability to directly command the editor.

And I'm not at all sure that learning how to do it in WDSC is easier than learning the SEU technique. If one or two 'good' ways to do it in WDSC were posted, I think it would be very interesting to see them compared to an SEU solution. If nothing else, it could show green-screen developers a clearly mapped transition from one to the other. WDSC is clearly the future and transition should be addressed.

I mislead the list and I'm sorry. I _used_ to do this with Code400, but am unable to work out precisely how to do it in JLpex. In Code, I could write my little hoohickys in ReXX, which was simple enough for me to understand and use. Now I have to do it in Java, I think. I'm still poking through the documentation, which is extensive :-/

Here's how I did it in Code, from start to finish:

alt-f, N, (new file c:\buck\macros\toalpha.lx)

/* Convert DDS fields from numeric to character */

'top'

do until 1 <> 1

'extract class'
'extract content'

/* skip comments */
  if pos('COMMENT', class) = 0 then do
    'extract element'

    /* set to char */
    NewContent = substr(content, 1, 34) || '   ' || substr(content, 38)
    'set content 'strip(NewContent, 't')
    call ExitTest

    /* get rid of EDTxxx */
    if pos('EDT', content) <> 0 then do
      'delete'
      call ExitTest
    end

  end

'next'
call ExitTest

end

ExitTest:
  'extract element'
  'extract elements'
  if element >= elements then do
    exit
  end
  return

ctrl-s (save)
alt-left (switch window to DDS)
<escape> (to get to command line)
extras on c:\buck\macros (if not in profile.lx)
macro toalpha

==========
The beauty of this is that I can now call this macro from another macro, so if I have a project that entails several mods, I can script the lot in one macro that cycles through the various windows in Code and performs the appropriate operation to each (which might be onoe thing for RPG, another for DDS, etc.)

All of the information needed to do this is in Help, Editor Reference, and there's no compile/test cycle. Fix the macro, alt-left and rerun it.

I believe that now I will need to learn enough Java to get this done. The documentation mostly appears to be a Javadoc. Help, Reference, APIs, LPEX API documentation.

  --buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.