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: 6970
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: 1275
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: 6970
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 Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Need help with 002-030 ABEND in TSO R... Terry Tallian TSO/ISPF 0 Sat Mar 17, 2018 1:13 am
No new posts Find a string in PS file opened in br... mukkas CLIST & REXX 3 Sat Feb 24, 2018 2:15 pm
No new posts presentation for ISPF developer newby Pedro TSO/ISPF 3 Tue Feb 13, 2018 4:37 am
No new posts OUTREC with ALter Command scorp_rahul23 DFSORT/ICETOOL 1 Wed Nov 22, 2017 3:10 pm

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