View previous topic :: View next topic
|
Author |
Message |
raghav08 Currently Banned New User
Joined: 03 Jun 2008 Posts: 94 Location: Bangalore
|
|
|
|
Hello.
I have a flatfile (FB,LRECL=133), I want to copy the block records which comes under column 1-5 to 55-60 (at present column 55-60 is empty). Please le me know the command used for this.
Thanks. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
If the file is small enough to be edited, start playing around with the BNDS and ) line commands, if not use SORT. |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
You can write a small edit macro to read each line, use the Rexx overlay() function and rewrite the line. I assume you want to pad the extra character with a blank (source is 5 chars long, dest is 6)
Code: |
Address isredit
'MACRO'
'(LAST) = LINENUM .ZL'
Do a=1 to last
'(LINE) = LINE 'a
line = overlay(substr(line,1,5),line,55,6,' ')
'LINE 'a ' = (LINE)'
End
|
|
|
Back to top |
|
|
|