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

insert string at the middle using ispf command


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
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
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: 6966
Location: porcelain throne

PostPosted: Wed Feb 01, 2012 9:44 am
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
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: 1353
Location: Israel

PostPosted: Wed Feb 01, 2012 7:14 pm
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: 6966
Location: porcelain throne

PostPosted: Wed Feb 01, 2012 7:39 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Routing command Address SDSF to other... TSO/ISPF 2
Search our Forums:

Back to Top