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

Rexx program for 'COLS' line command


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 81
Location: chennai

PostPosted: Thu May 27, 2010 2:44 pm
Reply with quote

Hi All,

I want to see the Rexx program for 'COLS' line command(column ruler display). where can i get the source code for ISPF Lline Commands? please help me on this.


Thanks and Regards,
Nath.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu May 27, 2010 3:16 pm
Reply with quote

I would say that these are probably programs supplied by IBM. I do not believe that they will be readily willing to release the source code to all and sundry.

Perhaps if you explain why you want this, then someone may be more able to assist.
Back to top
View user's profile Send private message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 81
Location: chennai

PostPosted: Thu May 27, 2010 3:48 pm
Reply with quote

Yes expat,

Base on that code i want to modify the functionality of the logic and i want to implement new macro as SCOLS. It’s customized the position of starting where the cursor is positioned which is simpler to count the length. Like below

Code:


Command ===>                                                  Scroll ===> CSR 
000700 ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890abcdefghijk
000800 ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890abcdefghijk
=SCOLS>        ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000900 ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890abcdefghijk
001000 ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890abcdefghijk
001100 ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890abcdefghijk
/*********************************************************************/   



By using this we can easily says the length of the chars from I to k which is 40 or from I to any chars after of line ‘000900’.

Please help on the coding.

-Nath.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu May 27, 2010 3:54 pm
Reply with quote

Now this is real fun.
I hope this topic is a joke, if not im wondering
if anyone should take this topic serious. 36_2_18.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu May 27, 2010 4:02 pm
Reply with quote

PeterHolland wrote:
Now this is real fun.
I hope this topic is a joke, if not im wondering
if anyone should take this topic serious. 36_2_18.gif

Ditto
Back to top
View user's profile Send private message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 81
Location: chennai

PostPosted: Thu May 27, 2010 4:25 pm
Reply with quote

Hi,

If you people are understood this topic as funniest thing, I am sorry on this. And please let me know how you count the chars of a line in flat file with in 2 or 3 sec which is not have any lay out. I hope it’s hardly taking 4-8 min for individual fields from where they start. Just think on it and we probably facing this type of calculations while coding in JCL SORT card.

Please ignore this and I will try with my self and thanks for your help and comment.

-Nath.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu May 27, 2010 4:31 pm
Reply with quote

Well i never had any problem to get the length from a postion other than
1 to position x. Yes there is some calculation to be done, and yes it takes
1-2 seconds (if you have to scroll left/right).
If that is too difficult for you, what the hell are you doing in IT?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu May 27, 2010 4:45 pm
Reply with quote

Basic arithmetic lesson #1: end column - start column + 1 gives length of data. So the data from column 9 to column 27 requires 27 - 9 + 1 equal 19 bytes. If I have a batch of fields, I put the starting columns in a spreadsheet, calculate the ending columns and therefore field length from just that data. If I have 50 or 75 fields, it'll take a few minutes to enter and double check the starting locations but the calculations then take essentially no time at all.

IBM does not release source code for their system, so unless you actually work for IBM in the area involved with ISPF edit, you have no chance of seeing the source for the COLS command. And I doubt the source is in REXX, anyway.

If you are spending your work time attempting to do things like this (which should have been learned in an early computer class), you're going to have a difficult career in IT, no matter how short it is. Most companies want you working on THEIR problems, not made up issues.
Back to top
View user's profile Send private message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 81
Location: chennai

PostPosted: Thu May 27, 2010 4:46 pm
Reply with quote

Hi Peter,

I know what I am doing in IT field and I hope that I am doing well to find out the simplest ways in our routine work and FYI this is also one of the part in our field.

Please stop this if you don’t know and please don’t continue with showing your hard words. Thanks

-Nath.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu May 27, 2010 5:49 pm
Reply with quote

Quote:
If you people are understood this topic as funniest thing,

funny no, dramatic certainly yes icon_cool.gif

Quote:
I know what I am doing in IT field and I hope that I am doing well to find out the simplest ways in our routine work and FYI this is also one of the part in our field.
icon_biggrin.gif icon_biggrin.gif
apart the basic skill of expressing clearly a requirement
and apart that most utilities need a starting col, and Your approach will not show it

friendly advice ( politically correct for ... I could not care less )
telling loud how smart one is is the most laughable thing to be said on a forum
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Thu May 27, 2010 7:34 pm
Reply with quote

Nath,

Please read about the COLS and LINE_BEFORE macro instructions in the 'Edit and Edit Macros' manual.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu May 27, 2010 7:58 pm
Reply with quote

Pedro wrote:
Please read about the COLS and LINE_BEFORE macro instructions in the 'Edit and Edit Macros' manual.
Got a link to such?

Without a terminal handy, I seem to recall that highlighting a line of characters would result in a border display showing how many characters were highlighted, but I've been wrong before....grin.....

And, FWIW, I thought the original question was a sensible request for guidance, and not a (typical) demand for (do it for me) help and did not deserve the ridicule posted.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Thu May 27, 2010 9:18 pm
Reply with quote

1. COLS does not exist as an edit MACRO command; COLS only exists as a NATIVE edit ( primary or line ) command.

2 A link to the LINE_BEFORE edit macro command.

3. Here is an edit Macro to accomplish what the TS wanted. To invoke, enter SCOLS on the command line, place your cursor on the word you want to highlight, and press ENTER ( note: there are 40 spaces between the parens for SPA ):
Code:
  ISREDIT MACRO                                             
  ISREDIT (CROW,CPOS) = CURSOR                               
  SET &SLEN = &CPOS - 1                                     
  SET &CLEN = 81 - &CPOS                                     
  SET &SPA  = &STR(                                        )
  SET &SPB = &STR(&SPA.&SPA)                                 
  SET &SPC = &SUBSTR(1:&SLEN,&SPB)                           
  SET &MASKA = &STR(....+....1....+....2....+....3....+....4)
  SET &MASKB = &STR(....+....5....+....6....+....7....+....8)
  SET &MASKC = &STR(&MASKA.&MASKB)                           
  SET &MASKD = &SUBSTR(1:&CLEN,&MASKC)                       
  SET &SCOL = &STR(&SPC.&MASKD)                             
  ISREDIT LINE_BEFORE &CROW = NOTELINE (SCOL)
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Thu May 27, 2010 9:24 pm
Reply with quote

> Got a link to such?

I think any set of ISPF manuals will do. Here is the link I use:
www-03.ibm.com/systems/z/os/zos/bkserv/r11pdf/#ispf

I do not recall that there was a highlighting requirement listed by the poster.

This is the exercise as I understand it:
setup:
1. create editor macro.
2. assign PF key to invoke macro

execute:
1. user positions cursor on particular line and column
2. user presses PF key to invoke macro
3. macro executes and determines cursor location
4. macro adds a NOTELINE or INFOLINE with appropriate column grid
Back to top
View user's profile Send private message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 81
Location: chennai

PostPosted: Fri May 28, 2010 11:23 am
Reply with quote

Hi All,

Thanks for your suggestions and help on this post. I was just asked to experts in this forum that is we have any possibilities to get such type of source code for inbuilt Line/Primary commands. And I explained my requirement to who is asked me. If any one takes this post as funny and dramatic way please reply your opinions to my private inbox. Thanks for putting your efforts on this.

And Thanks to Pedro and CICS Guy for your help & support and special thanks to Ronald Burr for your CODE.

-Nath
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Fri May 28, 2010 11:30 am
Reply with quote

Sometimes I have to do the same kind of maths.
I'm a bit lazy too, so this is how I do it:
- display column numbers with standard COLS command.
- select the area I want to count with the mouse (just as I do for Ctrl-C/Ctrl-V).
- move the select rectangle over the COLS line, starting at col 1.
- get the answer.

That's easy, no need for macro, it works every time. icon_smile.gif

And sometimes I move the select rectangle to other parts of the screen,
it's useful when I want to know if a string will fit in the line, for example.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri May 28, 2010 7:02 pm
Reply with quote

Ronald, it is time to start learning rexx.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Sat May 29, 2010 6:41 am
Reply with quote

Pedro,
I "started" learning Rexx many years ago - and have written my share of Rexx Execs.
But CLIST could be thought of as my "native" mainframe scripting language, just as English is my native social language. It's what I first learned and made use of extensively, and that was before Rexx was available.
So, unless I feel the need to utilize some of the more powerful Rexx functions ( e.g. PARSE, EXECIO, etc. ) I still code in CLIST because that language is more "natural" for me. It's kind of like - I know enough Spanish to get by, but if I'm in Spain, and encounter a Spaniard who speaks very good English, I can communicate with him a lot better speaking English than Spanish. And even if I DID learn to speak Spanish fluently, I wouldn't forsake English because I could now speak Spanish - so why should I forsake CLIST because I can code Rexx? Frankly, the mainframe doesn't care whether the language I use is Rexx or CLIST - it is fluent in both.
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Using API Gateway from CICS program CICS 0
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top