Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Align second word to specific column

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
Stephan Arenswald

New User


Joined: 08 Jul 2014
Posts: 2
Location: Germany

PostPosted: Tue Jul 08, 2014 12:00 pm    Post subject: Align second word to specific column
Reply with quote

Hi,

I want to align the second word in a given line to a specific column in the ISPF editor.

So when I have the following

Code:
key value
keykeykey value
keykey                   value


what I want to have is (the second word is aligned on the 19th column)

Code:
key               value
keykeykey         value
keykey            value


I'm actually searching for a sequence of line or primary commands in the ISPF editor. As an alternative I would use REXX but I'm not sure how to start with it. Furthermore, as this is a one time effort just having this sequence would be better.

But I'm open to any suggestions and help icon_smile.gif

Regards, Stephan
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Jul 08, 2014 12:15 pm    Post subject: Reply to: Align second word to specific column
Reply with quote

Is the second value always the same, as you have shown with your sample?
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 982
Location: Oostende, Belgium

PostPosted: Tue Jul 08, 2014 12:15 pm    Post subject:
Reply with quote

Start reading about bnds and the '>' line command.
Back to top
View user's profile Send private message
Stephan Arenswald

New User


Joined: 08 Jul 2014
Posts: 2
Location: Germany

PostPosted: Tue Jul 08, 2014 6:35 pm    Post subject:
Reply with quote

@prino: I played around with bnds and > and it works in case the file just contains those lines. However, what I didn't show in my sample lines above I excluded some commentary lines and it seems that bnds and > doesn't support the nx flag like in c or f.

@Bill Woodger: Nope, they are not the same

Here is a better example of my input file. I excluded all the comment file using x.

Code:
key value1
* some comment comment comment *
keykeykey value2
keykey                   value3
Back to top
View user's profile Send private message
Paul Voyner

New User


Joined: 26 Nov 2012
Posts: 51
Location: Switz

PostPosted: Wed Jul 09, 2014 12:44 pm    Post subject:
Reply with quote

Stephan, based on your example, try:
- Set right-hand boundary with BNDS
- X to exclude comments
- C ' ' ' ' all nx (note this is changing 1 blank to 2 blanks)
- Retrieve and reenter the C command until everything aligned

Or put the above in a simple edit macro
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Jul 09, 2014 12:55 pm    Post subject: Reply to: Align second word to specific column
Reply with quote

Nice thought. You can get the C(hange) command to stay on the command line (usually prefix with &), and just press enter until the alignment stops.
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Wed Jul 09, 2014 10:59 pm    Post subject: Reply to: Align second word to specific column
Reply with quote

You learn something every day. I did not know the '&' worked in the ISPF editor.
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Wed Jul 09, 2014 11:22 pm    Post subject: Reply to: Align second word to specific column
Reply with quote

Quote:
- Set right-hand boundary with BNDS

I tried the process described but the sample text, 'value1', stops shifting right too early. It stops when the rightmost text reaches the boundary.
Code:
=BNDS> <                         >       
==ERR> key                  value1       
- - -  -  -  -  -  -  -  -  -  -  -  -  -
==ERR> keykeykey            value2       
==ERR> keykey                    value3 

I suppose I can just move the right boundary if all of 'value1', 'value2', and 'value3' are the same length. But if the lengths are different, it will not work correctly.

The results are better if you do not use BNDS at all but instead set the boundary within the change command itself:
Code:
&C ' ' '  ' all nx 1 25
Back to top
View user's profile Send private message
Paul Voyner

New User


Joined: 26 Nov 2012
Posts: 51
Location: Switz

PostPosted: Thu Jul 10, 2014 1:12 pm    Post subject:
Reply with quote

@Pedro, I guess it depends if he wants the "value" column right- or left-aligned. What you suggest is the one to use for left-aligned (and you don't get ==ERR messages)
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Thu Jul 10, 2014 9:12 pm    Post subject: Reply to: Align second word to specific column
Reply with quote

From the original post:
Quote:
what I want to have is (the second word is aligned on the 19th column)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts how to split records based on specifi... Venkata Ramayya DFSORT/ICETOOL 6 Wed Sep 28, 2016 3:20 am
No new posts How to calculate an specific transact... lind sh CICS 2 Tue Sep 13, 2016 9:20 pm
No new posts Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us