View previous topic :: View next topic
|
Author |
Message |
ankvardhan
New User
Joined: 05 Sep 2008 Posts: 14 Location: Mumbai
|
|
|
|
Hi,
I need to replace the starting 10 bytes of my file with Zeroes, how can i do the same.
eg: file format :
999999999999
888888888888
777777777777
O/P required :
0000000099999
0000000088888
0000000077777
Hope for the positive reply.
Thanks,
Ank |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Usual questions
RECFM, LRECL |
|
Back to top |
|
|
ankvardhan
New User
Joined: 05 Sep 2008 Posts: 14 Location: Mumbai
|
|
|
|
Expat, i couldn't get you from Rec Format and its length.
only i need to replace the starting 10 bytes from ZEROES.
SORT FIELDS=(1,10,CH,A)
OUTREC FIELDS=(1:1,10,123X)
i used the above defined sortcard, but it gives an spaces.
can you help me out how to define zeroes.
Thanks,
Ank |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
you say you want to replace the first 10 bytes with zeroes, but your output shows only 8 zeroes.
Anyway, this will replace the 10 first bytes
Code: |
OUTREC OVERLAY=(1:C'0000000000')
|
Gerry |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
ankvardhan wrote: |
Expat, i couldn't get you from Rec Format and its length. |
What is the RECFM and LRECL of the input dataset. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
123X - i used the above defined sortcard, but it gives an spaces.
can you help me out how to define zeroes. |
You can use C'0' for a character zero or nC'0' for n character zeros.
If you want to overlay the first 10 bytes with character zeros, you can use:
Code: |
OPTION COPY
OUTREC OVERLAY=(1:10C'0')
|
You can use a SORT statement instead of OPTION COPY if appropriate.
If that's not what you want to do, then you need to explain more clearly what you want to do with a good example of your input records and what you expect for output. |
|
Back to top |
|
|
|