Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
insert string at the middle using ispf command

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

New User


Joined: 25 Nov 2010
Posts: 70
Location: Sivakasi, India

PostPosted: Wed Feb 01, 2012 8:52 am    Post subject: insert string at the middle using ispf command
Reply with quote

I want to insert a string at the middle of a particular record say at the posiition 20 such that the subsequent characters(present at the position from 20 to 380) should be moved accordingly. The file has a record length of 500 bytes and the record already has 400 characters. The string to be inserted is 10 bytes long. Any ispf command for this to mske it easy?
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Feb 01, 2012 9:44 am    Post subject:
Reply with quote

as you are editing the ds,
use the primary command BOUNDS, set your bounds to 20 *
use the line command SHIFT RIGHT 10 on all the records that you wish to insert the new data.
use the line command INSERT, type in your 10 char data.
use the primary command BOUNDS, set your bounds to * 29
use the line command M (or C) on your inserted line
use the line command O on the record which you wish to insert the new data
(or use OO on the first record and OO on the last record you wish to modify)
delete your inserted line.

have fun.
Back to top
View user's profile Send private message
Stefan

Active User


Joined: 12 Jan 2006
Posts: 110
Location: Germany

PostPosted: Wed Feb 01, 2012 11:50 am    Post subject:
Reply with quote

If the characters surrounding the insertion point are unique you can do it with a single CHANGE command.

Assume your data line contains:
Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+
000041   t  TYPE(CHAR)   INTENS(HIGH) COLOR(TURQ)   GE(ON)             

Now you want to insert 'CAPS(ON) between the INSERT and the COLOR keyword. In this case the 3-character string ') C' identify the insertion point uniquely.
Enter:
Code:
Command ===> c ') C' ') CAPS(ON) C'

The result will be:
Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+
000041   t  TYPE(CHAR)   INTENS(HIGH) CAPS(ON) COLOR(TURQ) GE(ON)       
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1243
Location: Israel

PostPosted: Wed Feb 01, 2012 7:14 pm    Post subject:
Reply with quote

dbzTHEdinosauer wrote:
as you are editing the ds,
use the primary command BOUNDS, set your bounds to 20 *
use the line command SHIFT RIGHT 10 on all the records that you wish to insert the new data.
use the line command INSERT, type in your 10 char data.
use the primary command BOUNDS, set your bounds to * 29
use the line command M (or C) on your inserted line
use the line command O on the record which you wish to insert the new data
(or use OO on the first record and OO on the last record you wish to modify)
delete your inserted line.

have fun.

And when finished, don't forget to reset your bounds to 1 500...
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Feb 01, 2012 7:39 pm    Post subject:
Reply with quote

would also back up the file, before changing.
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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts Conditional highlighting of rows in I... packerm CLIST & REXX 2 Thu Sep 21, 2017 6:50 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us