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 

need to join lines into one line in line 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
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Wed Nov 02, 2005 5:00 pm    Post subject: need to join lines into one line in line command Reply with quote

Hai all,

I want to join both the lines into one line but without no spaces between the words .Which line command should i give to obtain my desired result ?



Code:

000009        RAJAKUMAR                                                       
000010                        REDDY                                           
****** **************************** Bottom of Data ****************************



DESIRED OUTPUT
----------------

Code:

000009        RAJAKUMARREDDY                                                   
****** **************************** Bottom of Data ****************************


_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
SureshKumar
Intermediate


Joined: 23 Jan 2003
Posts: 211
Topics: 21

PostPosted: Wed Nov 02, 2005 5:32 pm    Post subject: Reply with quote

shekar123,
TF will get you there, however I doubt it would remove all the spaces. Try it out. Thanks
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Thu Nov 03, 2005 12:53 am    Post subject: Reply with quote

Hai Suresh,

This is what i have tried.I do not want spaces between the two words.Can u please tell me how can i get the desired output which i am expecting ?



Code:

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000009        RAJAKUMAR                                                       
000010                               REDDY                                     
****** **************************** Bottom of Data ****************************



Code:

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
TF0009        RAJAKUMAR                                                       
000010                               REDDY                                     
****** **************************** Bottom of Data ****************************




Code:

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000009        RAJAKUMAR REDDY                                                 
****** **************************** Bottom of Data ****************************


DESIRED OUTPUT

Code:

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000009        RAJAKUMARREDDY                                                 
****** **************************** Bottom of Data ****************************


_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Thu Nov 03, 2005 5:32 am    Post subject: Reply with quote

I don't know how is your exact data but in this case you could do "c ' ' '' 8 80" all
Back to top
View user's profile Send private message Send e-mail
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Nov 03, 2005 6:06 am    Post subject: Reply with quote

Shekar123,

Are you trying to do this merge operation manually or do u have any rexx code to do this ? If you already using any REXX then you can probably code a simple logic to do this operation.

Thanks,
Phantom
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Thu Nov 03, 2005 6:14 am    Post subject: Reply with quote

I use a macro called SPLTJOIN, which will either split a line at the cursor position, or join two lines by inserting the content of the second line at the cursor position in the first line. It's easiest to use if you set a PF key to SPLTJOIN.

It will accomplish your requirement. Have a play with it and see if it's good enough.

Code:

/* rexx version of spltjoin clist */                 
                                                     
address isredit                                     
"MACRO"                                             
"(LINE,COL) = CURSOR"                               
if col = 0 then                                     
   do                                               
      zedsmsg = 'Invalid cursor position'           
      zedlmsg = 'The cursor must be in the data',   
                'area to split or join'             
      address ispexec "SETMSG MSG(ISRZ001)"         
   end                                               
else                                                 
   do                                               
      "(WIDTH)     = DATA_WIDTH"                     
      "(LAST)      = LINENUM .ZLAST"                 
      "(LBND,RBND) = BOUNDS"                         
      "BOUNDS        1" width                       
      "(MASK)        = MASKLINE"                     
      "MASKLINE      = ' '"                         
      "TSPLIT"                                       
      "(SIZE)        = LINENUM .ZLAST"               
      if size = last then                                       
         if line = last then                                   
            do                                                 
               zedsmsg = 'At bottom of file'                   
               zedlmsg = 'A join has no effect',               
                         'at the bottom of the file'           
               address ispexec "SETMSG MSG(ISRZ001)"           
            end                                                 
         else                                                   
            do                                                 
               next = line + 1                                 
               "(CURRENT) = LINE" line                         
               "(AFTER)   = LINE" next                         
               after = strip(after)                             
               aftlen = length(after) + col - 1                 
               if aftlen > width then                           
                  do                                           
                     zedsmsg = 'Truncation would occur'         
                     zedlmsg = 'JOIN would truncate the data', 
                               'so no join is done'             
                     address ispexec "SETMSG MSG(ISRZ001)"     
                  end                                           
               else                                             
                  do                                           
                     current = substr(current,1,col-1)||after   
                     "LINE" line " = (CURRENT)"                 
                     "DELETE" next                             
                     "CURSOR =" line col                       
                  end                                           
            end                                                 
      "BOUNDS" lbnd rbnd                                       
      "MASKLINE = (MASK)"                                       
   end                                                         

_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Thu Nov 03, 2005 8:53 am    Post subject: Reply with quote

Mervyn,

I am not using any Rexx at all ,i just want to try any line command to accompolish my task to get the desired result.Is there any line command to remove spaces between the words in a single shot.

DESIRED OUTPUT
---------------------

Code:

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000009        RAJAKUMARREDDY                                                 
****** **************************** Bottom of Data ****************************


_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Nov 03, 2005 9:35 am    Post subject: Reply with quote

Quote:

I am not using any Rexx at all ,i just want to try any line command to accompolish my task to get the desired result.Is there any line command to remove spaces between the words in a single shot.



As far as I know there is no Such line command which can do what you are asking for !

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Nov 03, 2005 9:44 am    Post subject: Reply with quote

Shekar123,

Is this a one time activity ? I think the best way is to write a small rexx routine or customize the one given by Mervyn. Believe me, it does not take much time but not worth if this is not going to be a repeated activity.

Thanks,
Phantom
Back to top
View user's profile Send private message
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