View previous topic :: View next topic |
Author |
Message |
naveen Beginner
Joined: 03 Dec 2002 Posts: 90 Topics: 31
|
Posted: Mon Jan 13, 2003 12:05 am Post subject: Replace data with spaces |
|
|
Consider this input file:
Code: | a1111 sfs hfsf yufss
b1111 sdf fshs ithfff
c1111 dfs dfsf ff
d2222 ews 222e 22222
e3333 dsd fsfs f |
Now I want to insert SPACES in place of each entry in column 4 i.e. from position 16 onwards.i.e.
Code: | yufss
ithfff
ff
22222 |
should all be replaced by spaces.
How to do this ? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12368 Topics: 75 Location: San Jose
|
Posted: Mon Jan 13, 2003 12:10 am Post subject: |
|
|
Naveen,
You can use outrec to get the desired results.
Code: |
SORT FIELDS=COPY
OUTREC FIELDS=(1,15, $ COPY FIRST 15 BYTES FROM INPUT
6X, $ PAD WITH 6 SPACES FOR COLUMN 4
22,n) $ REST OF THE FIELDS (IF ANY)
/*
|
Hope this helps...
cheers
kolusu |
|
Back to top |
|
|
naveen Beginner
Joined: 03 Dec 2002 Posts: 90 Topics: 31
|
Posted: Tue Jan 21, 2003 12:10 am Post subject: |
|
|
Kolusu,
your solution is giving me Syntax Error. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12368 Topics: 75 Location: San Jose
|
Posted: Tue Jan 21, 2003 12:41 am Post subject: |
|
|
Naveen,
Can you post the exact error message??
Thanks
Kolusu |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Tue Jan 21, 2003 11:03 am Post subject: |
|
|
Naveen,
I'm guessing you coded 22,n as shown. You have to replace n with an appropriate length. For example, if your input records are 80 bytes long and you want your output records to be 80 bytes long, you would use 22,59 (80 - 21 = 59). _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
|
|