Appending library to each line in file of record numbers (make "p_ret_01 format"
- Article Type: General
- Product: Aleph
- Product Version: 20, 21, 22, 23
Description:
I have a file of record numbers (produced by SQL) which I want to use as input to a batch job (p_manage_40, p_manage_21, etc.). How can I add the library after the number on each line (so it looks like the form produced by p_ret_01). That is, how can I automatically change:
000123456
000123482
000124869
to:
000123456EXU01
000123482EXU01
000124869EXU01
Resolution:
vi the file and enter this command:
:1,$ s/$/EXU01/
Note A: Any blank lines in the file will also have "EXU01" inserted, so blank lines should be eliminated before doing this.
Note B: One site complained that when they did the above command they got this result:
000123456
EXU01
000123482
EXU01
000124869
EXU01
[From site:] I got this figured out...I was generating the sys numbers from an SQL script file but forgot to 'SET' the linesize to 9. So in effect, the 9-character system number became 80-characters (71 blank spaces after the sys number). The appending of EXU01 to the end happened at character 81, which made it seem like it was creating a new line in unix.
Additional Information
append library
- Article last edited: 10/8/2013