cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
While you may used the REPL or EDIT options to change fields, there are no options in batch FILEAID to suppress zeroes.
If you had records such as these with a numeric field in position 5.
Code: |
ABCD0000000000DEFG
ABCD0000000123DEFG
ABCE0000033343DEFH
ABCF0000897653DEFI
ABCF0333397653DEFI
|
You could use a FILEAID setup like this to suppress the zeroes:
Code: |
//FILEAID EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//DD01 DD *
ABCD0000000000DEFG
ABCD0000000123DEFG
ABCE0000033343DEFH
ABCF0000897653DEFI
ABCF0333397653DEFI
//DD01O DD DSN=HLQ.OUTPUT,
// UNIT=SYSDA,DISP=(NEW,CATLG),
// RECFM=FB,LRECL=80,BLKSIZE=27920,
// SPACE=(TRK,(1,1),RLSE)
$$DD01 CA REPL=(5,EQ,C'0000000000',C' '),
REPL=(5,EQ,C'000000000',C' '),
REPL=(5,EQ,C'00000000',C' '),
REPL=(5,EQ,C'0000000',C' '),
REPL=(5,EQ,C'000000',C' '),
REPL=(5,EQ,C'00000',C' '),
REPL=(5,EQ,C'0000',C' '),
REPL=(5,EQ,C'000',C' '),
REPL=(5,EQ,C'00',C' '),
REPL=(5,EQ,C'0',C' ')
/*
|
Your OUTPUT file would look like:
Code: |
ABCD DEFG
ABCD 123DEFG
ABCE 33343DEFH
ABCF 897653DEFI
ABCF 333397653DEFI
|
If you want to update the file in place, you can delete the DD01O DD statement and use UPDATE parameter rather than CA (copyall) in your control cards. |
|