Posted: Tue Oct 12, 2004 10:29 am Post subject: converting spaces to zeros
Hi
i have a sequential file (FB) of length 270. The field starting from position 168 is defined as S9(3) COMP-3 and for certain records - this field contain spaces. i need to convert the spaces to zeros for that field for those records.
is it possible to do it by using DFSORT?
Think TRAN=ALTSEQ can convert zeros to spaces but not vice versa.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Oct 12, 2004 11:51 am Post subject:
Quote:
is it possible to do it by using DFSORT?
Think TRAN=ALTSEQ can convert zeros to spaces but not vice versa.
DFSORT's TRAN=ALTSEQ can change X'00's to X'40's and X'40's to X'00's. In fact, it can change any hex character to any other hex character.
But as Kolusu pointed out, changing X'4040' to X'0000' will NOT give you the correct type of zeros for your S9(3) COMP-3 since that's a 2-byte PD field for which you need X'000C' to correctly represent a 0 value. Kolusu's DFSORT job uses CHANGE to give you the correct type of 0.
For a table showing the equivalent DFSORT fields for COBOL data types, see the "What are the equivalent DFSORT formats for various COBOL data types?" Ask Professor Sort item at:
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