|
View previous topic :: View next topic
|
| Author |
Message |
maki_psg
New User
Joined: 28 Jan 2010 Posts: 47 Location: India
|
|
|
|
Hi,
I have a sort card to sum up the decimal values as below. But this is working for only unsigned values. How to use the same thing for signed fields. ie, if the same suming up field is a signed one, this is not working. please help me.
| Code: |
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=USER.FILE1,DISP=SHR
//SORTOUT DD DSN=USER.FILE2,...
//SYSIN DD *
INREC FIELDS=(1,2484,2485,14,UFF,ZD,LENGTH=14,2499,1102)
SORT FIELDS=(2720,11,CH,A)
SUM FIELDS=(2485,14,ZD)
OUTREC FIELDS=(1,2484,2486,11,C'.',2497,2,2499,1102)
/*
//SYSOUT DD SYSOUT=* |
|
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
| UFF |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Do you have this working now? |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
maki_psg,
It is not clear as to what you are trying to do. If you use UFF format to convert the data , it ignores the sign. If you have +100 and -100, they both will be converted to a positive value of 100.
You need to use SFF format (Signed Free format) which also takes the sign into consideration.
Use the following Control cards.
| Code: |
//SYSIN DD *
OPTION ZDPRINT
INREC OVERLAY(2485:2485,14,SFF,ZD,LENGTH=14)
SORT FIELDS=(2720,11,CH,A)
SUM FIELDS=(2485,14,ZD)
OUTREC OVERLAY=(2485:2485,14,ZD,EDIT=(STTTTTTTTTT.TT),SIGNS=(+,-))
//* |
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|