MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Edit macro command

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
sinjon
Beginner


Joined: 16 May 2006
Posts: 3
Topics: 1

PostPosted: Sun May 21, 2006 11:35 pm    Post subject: Edit macro command Reply with quote

I've created a small edit macro to automate a sequence of edit commands that I often manually enter. Everything works fine except for there's one command I don't know how to automate. Intereactively I'd use the MD (make data) command and I don't know how to incorporate that command into the macro.

For example, if interactively I always go to the fifth line and enter 'md30' to turn any notes or message lines within the next 30 lines into data, how would I do that from within a macro?
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Sun May 21, 2006 11:40 pm    Post subject: Reply with quote

Unfortunately, youj can't automate that through a simple edit macro. There is no macro access to 'special' lines like info or note lines. Only data lines are addressable.
Back to top
View user's profile Send private message Visit poster's website
sinjon
Beginner


Joined: 16 May 2006
Posts: 3
Topics: 1

PostPosted: Mon May 22, 2006 12:18 pm    Post subject: Reply with quote

I don't actually want to do any specific processing of just the notes or info lines, just save them as data lines so they can then be processed like the rest of the data. No way to do theat through a macro... seems odd since it so simple manually... Sad

Thanks for your reply
Back to top
View user's profile Send private message
stefan
Beginner


Joined: 20 Nov 2003
Posts: 41
Topics: 2
Location: Germany

PostPosted: Tue May 23, 2006 8:18 am    Post subject: Reply with quote

You could write a macro which captures the contents of the current screen, parse it, and process as you need.
Code:

eyecatcher = '==CHG>'
address ispexec 'vget zscreeni'
p = pos(eyecatcher,zscreeni)
do while p > 0
   lineno = (p % 80) - 4
   say 'data on line' lineno 'contains'
   say substr(zscreeni,(p+7),72)
   p = pos(eyecatcher,zscreeni)
end

But keep in mind that this variable is NOT refreshed when scrolling down the data via DOWN macro command. You have to let the ISPF editor repaint the screen and thus cause zscreeni to contain the newly loaded screen data.

Hope this helps.
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Tue May 23, 2006 9:46 am    Post subject: Reply with quote

If you are going to go down that route, then the complete solution is to create an edit panel with a panel exit that captures and updates the zdata variable with the right commands and screen attribute bytes. But that still requires getting the screen to display each non-data line (scrolling) which is very hard to simulate from a macro.

Panel exits that interogate or manupulate edit data are possible -- I've written exits that remove or alter the line command area for use by screen readers for example -- but they are non-trivial and not easy to maintain.

The other way is to write an emulator macro. With a good emulator language (EHLLAPI or Vista's macro language for example, that would not be not too hard.

But edit macros themselves can't do it through any documented interface.
Back to top
View user's profile Send private message Visit poster's website
sinjon
Beginner


Joined: 16 May 2006
Posts: 3
Topics: 1

PostPosted: Wed May 24, 2006 10:31 pm    Post subject: Reply with quote

Well considering that I'll be dealing with thousands of lines, capturing the screen won't work. Perhaps in a loop, but I think it'd take too long with the size of the data set.
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Wed May 24, 2006 11:53 pm    Post subject: Reply with quote

Here is a thought...

  1. Manually MD all lines, MD9999 or if you have >9999 lines,
    1. X ALL
    2. MD on the excluded line
    3. RESET X
  2. COMPARE SESSION or COMPARE * (those are the same thing)
  3. That will give you a set of labeled lines where the new lines are. Then your macro can go through those lines and process them as needed, deleting the ones you don't want.

You can either calculate the label names (you'll see the pattern when you look at the labels, .Oxxxx where xxxx is a cycle AAAA, AAAB, ... AAAZ, AABA, AABB, etc , basically xxxx is a base26 'number' using alphabetic characters), or use LOCATE LABEL and the DISPLAY_LINES, something like this:
Code:
/* REXX  */
Address isredit
'MACRO'
'LOCATE LABEL FIRST'
locrc=rc
Do While locrc=0
  "(T) = DISPLAY_LINES"
  Say "Label found at line" t+0
  "LOCATE LABEL"
  locrc=rc
End
It is a litte bit manual, but maybe not too bad.
Back to top
View user's profile Send private message Visit poster's website
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Thu May 25, 2006 12:21 am    Post subject: Reply with quote

I think there is a better way to calculate the labels, but this small genlabel routine will do it:
Code:
/* Rexx - calculate compare labels   */
/*         using starting index of 1 */
Address isredit
Do a = 1 to 28
  Say genlabel(a)
End
Return

genlabel: Procedure
   i = Arg(1) - 1
   q = i % 17576   /* 26*26*26 */
   r = i // 17576  /* 26*26*26 */
   c = d2c(q)      /* 26*26*26 */
   q = r % 676     /* 26*26    */
   r = i // 676    /* 26*26    */
   c = c|| d2c(q)  /* 26*26    */
   q = r % 26
   r = i // 26
   c = c|| d2c(q)|| d2c(r)
   alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
   Return ".O"|| translate(c,alpha,xrange("00"x,"1F"x))
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group