View previous topic :: View next topic
|
Author |
Message |
sureshmurali Warnings : 1 New User
Joined: 25 Nov 2010 Posts: 70 Location: Sivakasi, India
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Stefan
Active User
Joined: 12 Jan 2006 Posts: 110 Location: Germany
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
would also back up the file, before changing. |
|
Back to top |
|
|
|