MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Insert some chars in a column

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Amit Manas Dubey
Beginner


Joined: 22 Jun 2007
Posts: 3
Topics: 2

PostPosted: Thu Jul 05, 2007 6:05 am    Post subject: Insert some chars in a column Reply with quote

I have a Sequential file with LRECL 87. I have multiple records in the file with length 85 and the last two chars are spaces.

I want to insert some chars in Column 14 and 15 and shift the rest of the record to the right.

Any ideas how I can achieve that ?

Are there any Line commands that can be used ?

Best regards,
Amit.
_________________
Manas
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Jul 05, 2007 6:35 am    Post subject: Reply with quote

Amit Manas Dubey,

1. Open the dataset in edit mode

2. Issue the following command at the command prompt and press enter
Code:

 X ALL ; F ' ' 86 ALL


3. now issue the following command at the command prompt and press enter

Code:

BNDS 14 87


4.now tab over to the line numbers and enter the following the line command on the first line
Code:

))2


5. Now go down to the last line and enter the following the line command on the last line
Code:

))2


6. Press enter

7. Now enter the following command at the command prompt and press ENTER

Code:

C ' ' C'YOUR STRING TO BE INSERTED' 14 NX ALL


8. Type RESET at the command prompt and voila you have desired results

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Jul 05, 2007 6:43 am    Post subject: Reply with quote

Amit Manas Dubey,

If the QSAM file is FB, with non-variable records of length 87, yes, you can edit the file and using the BOUNDS (BNDS) primary command and using the SHIFT RIGHT Cols/Char [>> / ))] line commands you can accomplish this.

PF1, while in edit mode, I for index, then check b - look for bounds, and then look for line commands.

e.g.

at the command prompt
  1. exclude all or x all
  2. Find all ' ' 86
  3. bnds 14 87

at this point, the only lines displayed are those with spaces in 86 and 87.
on each displayed line
  1. enter the line command > (a greater than sign)
  2. place the cursor on pos 14 and enter the 2 characters that you want.


IF the lines that have spaces in 86 and 86 are the only lines that will have spaces in 14 and 15 after the shift right, and you are going to insert the exact same characters in each line at positions 14 & 15 then you can omit number 2 above, and instead
  • Change ALL ' ' 'yy' 14 15 NX
which is change all spaces in 14 and 15 of non-excluded lines to yy (yy is your constant that you want to place in 14 & 15.

Before you start, at the command line enter: Recovery On. This will allow you to enter UNDO (same as ctl-z in MS-Windows) in the event that you do something 'wrong'.

Also, I would duplicate your qsam file, work on the duplicate, and then run a compare on the two files to insure what you have changed is what you intended. If all is ok, delete the original and rename the modified.

START USING PF1 yeah, I am yelling!!!!

(edited by dbz to correct the bnds command)
_________________
Dick Brenholtz
American living in Varel, Germany


Last edited by dbzTHEdinosauer on Thu Jul 05, 2007 7:04 am; edited 1 time in total
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Jul 05, 2007 6:47 am    Post subject: Reply with quote

Kolusu,

excellent idea using the shift spaces command on the complete file instead of doing what I suggested: shift characters on only those that have spaces in 86 & 87.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Amit Manas Dubey
Beginner


Joined: 22 Jun 2007
Posts: 3
Topics: 2

PostPosted: Thu Jul 05, 2007 6:49 am    Post subject: Reply with quote

Thanks a lot.

This worked.

Amit.
_________________
Manas
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group