Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 1232
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 saving your settings in ISPF. VintageReceiver TSO/ISPF 9 Wed Jul 26, 2017 6:42 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Customizing the ISPF HILITE Command Pedro TSO/ISPF 3 Fri Mar 03, 2017 11:49 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us