View previous topic :: View next topic
|
Author |
Message |
hallecodec
New User
Joined: 05 Sep 2006 Posts: 30 Location: Philippines
|
|
|
|
hi guys,
i have this file, LRECL=46 and RECFM=FB. with fields:
> field1 PIC 9(4)
> field2 PIC X(15)
> filler PIC X(1)
> sum1 PIC 9(18)
> sum2 PIC 9(18)
this is my sample input file:
Code: |
11401000000 000000000000001213000000000000001213
11401000002 000000000015804260000000000015804260
11401000003 000000001002833160000000001002811224
11401000010 000000000000000313000000000000000313
11401000013 000000000000589971000000000000589780
11401031001 000000000000000183000000000000000183
11401031002 000000000000000506000000000000000506
|
my requirement is using field1 and the first four characters of field2, i should execute a SUM FIELDS for sum1 and sum2.
this is the SORT step that i used:
Code: |
//STEP002 EXEC PGM=SORT
//SORTIN DD DSN=SUM1,DISP=SHR
//SORTOUT DD DSN=SUM2,DISP=(NEW,CATLG,DELETE),
// AVGREC=K,SPACE=(56,(1,1),RLSE),
// RECFM=FB,LRECL=56
//SYSIN DD *
SORT FIELDS=(1,8,ZD,A)
SUM FIELDS=(21,18,39,18),FORMAT=ZD
//SYSOUT DD SYSOUT=*
//
|
it ran successfully. however, the output looked like this:
Code: |
11401000000 00000000101922891G00000000101920679{
11401031001 00000000000000068I00000000000000068I
|
there are characters in the 38th and 56th positions after i've sum them up.
what could be the reason for these unwanted characters? please help. thanks in advance. |
|
Back to top |
|
|
hallecodec
New User
Joined: 05 Sep 2006 Posts: 30 Location: Philippines
|
|
|
|
sorry. the LRECL should be 56, not 46. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
If by unwanted, you are referring to the G, I and {, those are the signs on the ZD numbers.
There are editing functions that will remove them back to unsigned ZD. |
|
Back to top |
|
|
hallecodec
New User
Joined: 05 Sep 2006 Posts: 30 Location: Philippines
|
|
|
|
hi william,
so, you mean that it is only natural for those characters to appear?
how could i remove those?
thanks in advance. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
Back to top |
|
|
hallecodec
New User
Joined: 05 Sep 2006 Posts: 30 Location: Philippines
|
|
|
|
hi krisprems and william,
thanks for the tip: OPTION ZDPRINT, this command was new to me. there are no more "unwanted characters" in my output. |
|
Back to top |
|
|
|