View previous topic :: View next topic
|
Author |
Message |
rdchris
New User
Joined: 22 May 2009 Posts: 8 Location: Kansas City
|
|
|
|
Good morning and thank you for taking the time to view my questions. In my spare time I created my first CLIST macro to automatically renumber a Job's JCL steps according to my company's standards. This I've been able to add all user-requested enhancnements up until this point but the one issue I will explain below have really stumped me.
The end of my macro looks incident enough and I believed that simply adding an exit code(1) would return the cursor to the command line effectively.
[End of Macro Code]
ISREDIT RESET
ISREDIT CURSOR = &OY &OX /* RETURNS TO THE ORIGONAL CURSOR POS */
EXIT /* EXITS MACRO */
Unfortuantly when I added the CODE(1) to send the cursor to the command line the macro began to ignore the ISREDIT CURSOR = &OY &OX cursor command. Interestingly enough when I added an ISREMSPY into the macro (see below) it always worked perfectly.
ISREDIT RESET LABEL
ISREDIT RESET
ISREDIT CURSOR = &OY &OX
ISREMSPY
EXIT CODE(1)
I am quite confused on why the cursor command would be ignored unless the ISREMSPY takes place, my instinct is that sometype of flush needs to take place to force the ISREDIT CURSOR command but I'm not experianced enough in CLIST to know for sure. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
Unfortuantly when I added the CODE(1) to send the cursor to the command line the macro began to ignore the ISREDIT CURSOR = &OY &OX cursor command. |
it' s You who has to make a decision where the cursor should be positioned ....
set the cursor somewhere in the edit area ( ISREDIT CURSOR ... ) or
set the cursor into the command line
ISREMSPY ( the debugging aid ) is sometimes a disturbance so the cursor position
might be clobbered |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
I'm confused. You stated that you move the cursor to x,y and then move it to the command line with the exit code(1) and it goes to the command line like you asked it to. What are you expecting it to do with exit code(1)? It sounds like you want the cursor to be in two places at once.
isremspy may not itself be the issue. it doesn't change any edit settings itself, but just the fact that there was a DISPLAY done by isremspy my have some effect. Is it the CURSOR command being honored or is the cursor just wherever the cursor was when you pressed enter in isremspy? |
|
Back to top |
|
|
rdchris
New User
Joined: 22 May 2009 Posts: 8 Location: Kansas City
|
|
|
|
MBabu wrote: |
I'm confused. You stated that you move the cursor to x,y and then move it to the command line with the exit code(1) and it goes to the command line like you asked it to. What are you expecting it to do with exit code(1)? It sounds like you want the cursor to be in two places at once.
isremspy may not itself be the issue. it doesn't change any edit settings itself, but just the fact that there was a DISPLAY done by isremspy my have some effect. Is it the CURSOR command being honored or is the cursor just wherever the cursor was when you pressed enter in isremspy? |
Perhaps I should have explained this part better. The goal of the cursor command is to return the user to the same point in the member as you started. For example I start the macro at line 100 & it runs through the entire JCL member, I want line 100 at the top of the screen when the macro completes so it feels as if the the cursor never changed position. My current code is accomplishing this.
The shortfall of my current code is that the cursor is returned to the label of line 100, I would like it to return to the command line as well.
So basically I'm trying to accomplish two things.
1. Reposition the cursor's place in the JCL member. [Currently accomplished before I add EXIT(1)
2. Return the cursor to the command line. [Works but then screws up 1].
I hope that clears things up. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
looks like there is a understanding barrier around here
Quote: |
1. Reposition the cursor's place in the JCL member. [Currently accomplished before I add EXIT(1)
2. Return the cursor to the command line. [Works but then screws up 1].
|
the cursor cannot be in two places at the same time,
as I said before You should choose one place and stick to it |
|
Back to top |
|
|
rdchris
New User
Joined: 22 May 2009 Posts: 8 Location: Kansas City
|
|
|
|
enrico-sorichetti wrote: |
looks like there is a understanding barrier around here
Quote: |
1. Reposition the cursor's place in the JCL member. [Currently accomplished before I add EXIT(1)
2. Return the cursor to the command line. [Works but then screws up 1].
|
the cursor cannot be in two places at the same time,
as I said before You should choose one place and stick to it |
So it's impossible to position the member & then move the cursor to the command line? Moving the cursor to the command line should not change the position in the JCL member imo. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
looks like there is a understanding barrier around here |
Yup, methinks we're not all on the same page
It may help if you post the sequence of what you want to enter from the keyboard and what should happen on the screen each time Enter or some PFkey is pressed.
I don't believe "2 things at once" are wanted, but "what should happen" and "in what order" is not yet clear. |
|
Back to top |
|
|
rdchris
New User
Joined: 22 May 2009 Posts: 8 Location: Kansas City
|
|
|
|
dick scherrer wrote: |
Hello,
Quote: |
looks like there is a understanding barrier around here |
Yup, methinks we're not all on the same page :wink:
It may help if you post the sequence of what you want to enter from the keyboard and what should happen on the screen each time Enter or some PFkey is pressed.
I don't believe "2 things at once" are wanted, but "what should happen" and "in what order" is not yet clear. |
In essence
1. [Save cursor position]
2. [Macro Logic]
3. [Return to old position]
4. [Return cursor to the command line]
Does that make things more clear? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Does that make things more clear? |
Unfortunately, my V-8 brain is running on about 3 cyls today. . .
I suspect that 1, 2, and 3 happen on one press of Enter. What interaction with the user is there between 3 and 4? If none, why return the cursor to the "old position"? |
|
Back to top |
|
|
rdchris
New User
Joined: 22 May 2009 Posts: 8 Location: Kansas City
|
|
|
|
Thank you I will rewrite the logic to use the locate command instead of ISREDIT CURSOR. Was the reason for my macro failing simply because I was attempting to use two cursor commands back to back? |
|
Back to top |
|
|
rdchris
New User
Joined: 22 May 2009 Posts: 8 Location: Kansas City
|
|
|
|
dick scherrer wrote: |
Hello,
Quote: |
Does that make things more clear? |
Unfortunately, my V-8 brain is running on about 3 cyls today. . . --)
I suspect that 1, 2, and 3 happen on one press of Enter. What interaction with the user is there between 3 and 4? If none, why return the cursor to the "old position"? |
There is no interaction. The user simply types in the macro name and 1-4 happens automatically. Since the user is assumed to be working at the current member location I didn’t want force them to navigate back to where they were when they triggered the macro. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I didn’t want force them to navigate back to where they were when they triggered the macro. |
Mighty kind. . .
If you have what is needed, this doesn't need a reply, but if there are 2 cursor movements during one user interaction, is/would the
3. [Return to old position]
ever be visable?
As i mentioned, i'm kinda slow today
d |
|
Back to top |
|
|
rdchris
New User
Joined: 22 May 2009 Posts: 8 Location: Kansas City
|
|
|
|
dick scherrer wrote: |
Hello,
Quote: |
I didn’t want force them to navigate back to where they were when they triggered the macro. |
Mighty kind. . . :)
If you have what is needed, this doesn't need a reply, but if there are 2 cursor movements during one user interaction, is/would the
3. [Return to old position]
ever be visable?
As i mentioned, i'm kinda slow today :oops:
d |
no it's not visible, only the final cursor position is visible. My macro moves the cursor position either via 'finds' or direct cursor movements a large number of times (10-10,000+) but only the final position is seen by the user. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1314 Location: Vilnius, Lithuania
|
|
|
|
rdchris wrote: |
... In my spare time I created my first CLIST macro ... |
We are in 2010, why in the world would you create a CLIST macro when there is a much better language called REXX? |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
have a look at the USER_STATE command. I think it does exactly what you want. The confusion is only from describing a proposed solution instead of the original problem. Better to describe the original goal (repositioning the data, not the cursor, to its original position) |
|
Back to top |
|
|
rdchris
New User
Joined: 22 May 2009 Posts: 8 Location: Kansas City
|
|
|
|
thanks for the advice everyone, I was able to reposition the JCL member using locate command and place the cursor on the command line using the exit code with no issue! |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
happy it worked! |
|
Back to top |
|
|
|