IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

CLIST Cursor position error with Exit Code(1)


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rdchris

New User


Joined: 22 May 2009
Posts: 8
Location: Kansas City

PostPosted: Wed Feb 10, 2010 10:27 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed Feb 10, 2010 11:04 pm
Reply with quote

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 icon_biggrin.gif
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Wed Feb 10, 2010 11:08 pm
Reply with quote

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
View user's profile Send private message
rdchris

New User


Joined: 22 May 2009
Posts: 8
Location: Kansas City

PostPosted: Thu Feb 11, 2010 12:09 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Thu Feb 11, 2010 12:29 am
Reply with quote

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
View user's profile Send private message
rdchris

New User


Joined: 22 May 2009
Posts: 8
Location: Kansas City

PostPosted: Thu Feb 11, 2010 12:51 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Thu Feb 11, 2010 12:58 am
Reply with quote

Hello,

Quote:
looks like there is a understanding barrier around here
Yup, methinks we're not all on the same page icon_wink.gif

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
View user's profile Send private message
rdchris

New User


Joined: 22 May 2009
Posts: 8
Location: Kansas City

PostPosted: Thu Feb 11, 2010 1:08 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Thu Feb 11, 2010 1:14 am
Reply with quote

if instead of speaking about setting the cursor You had said bring some line to the top of the screen everything would have been clearer icon_biggrin.gif

You can achieve that result using the locate command

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ISPZEM61/3.3.49?SHELF=ISPZPM61&DT=20071211170344
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Thu Feb 11, 2010 1:19 am
Reply with quote

Hello,

Quote:
Does that make things more clear?
Unfortunately, my V-8 brain is running on about 3 cyls today. . . icon_cool.gif

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
View user's profile Send private message
rdchris

New User


Joined: 22 May 2009
Posts: 8
Location: Kansas City

PostPosted: Thu Feb 11, 2010 1:19 am
Reply with quote

enrico-sorichetti wrote:
if instead of speaking about setting the cursor You had said bring some line to the top of the screen everything would have been clearer :D

You can achieve that result using the locate command

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ISPZEM61/3.3.49?SHELF=ISPZPM61&DT=20071211170344


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
View user's profile Send private message
rdchris

New User


Joined: 22 May 2009
Posts: 8
Location: Kansas City

PostPosted: Thu Feb 11, 2010 1:22 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Thu Feb 11, 2010 1:31 am
Reply with quote

Hello,

Quote:
I didn’t want force them to navigate back to where they were when they triggered the macro.
Mighty kind. . . icon_smile.gif

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 icon_redface.gif

d
Back to top
View user's profile Send private message
rdchris

New User


Joined: 22 May 2009
Posts: 8
Location: Kansas City

PostPosted: Thu Feb 11, 2010 1:53 am
Reply with quote

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
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1314
Location: Vilnius, Lithuania

PostPosted: Thu Feb 11, 2010 4:11 am
Reply with quote

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
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Thu Feb 11, 2010 9:57 am
Reply with quote

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
View user's profile Send private message
rdchris

New User


Joined: 22 May 2009
Posts: 8
Location: Kansas City

PostPosted: Fri Feb 12, 2010 1:41 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Fri Feb 12, 2010 1:42 am
Reply with quote

happy it worked!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Help on IMS -API URL migrating from P... IMS DB/DC 1
No new posts JES datasets IO Error ABENDS & Debugging 3
No new posts Error to invoke MPP program through B... IMS DB/DC 3
No new posts PKZIP error ZPFM121E and ZPCE009E JCL & VSAM 6
No new posts OpenPGP Decryption job getting LRECL ... IBM Tools 7
Search our Forums:

Back to Top