|
View previous topic :: View next topic
|
| Author |
Message |
mak_tcs
New User

Joined: 23 Nov 2005 Posts: 69 Location: Minneapolis, MN USA
|
|
|
|
Hello,
My input record is like this
| Code: |
| 3400015.67;0000015.45;07/14/2007 |
I am trying to subtract the field2 (0000015.45) from field1(3400015.67)
| Code: |
| OUTREC FIELDS=(1,10,ZD,SUB,12,10,ZD) |
is not working
Please help me to find out how to handle the decimal characters in the input record. Do I need to format them before I do this SUB operation?
Kindly advise! I am sorry if this is already been discussed
Thanks,
Mak |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use DFSORT's UFF (unsigned free form) format to do that:
| Code: |
OUTREC FIELDS=(1,10,UFF,SUB,12,10,UFF,EDIT=(TTTTTTT.TT))
|
I assumed you wanted the output field in the same form as the input field. If not, tell me what you want the output field to look like. |
|
| Back to top |
|
 |
mak_tcs
New User

Joined: 23 Nov 2005 Posts: 69 Location: Minneapolis, MN USA
|
|
|
|
Hi Frank,
I am getting the following error
| Code: |
SYSIN :
SORT FIELDS=COPY
OUTREC FIELDS=(1,10,UFF,SUB,12,10,UFF,EDIT=(TTTTTTT.TT),180X)
*
WER268A OUTREC STATEMENT : SYNTAX ERROR |
I am using
| Code: |
| //STEP01 EXEC PGM=SORT |
I appreciate your help on this.
Thanks!
Mak |
|
| Back to top |
|
 |
krisprems
Active Member

Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
mak_tcs
You are getting the error WER268A, because you are using SYNCSORT not DFSORT, and that its not supporting UFF feature. |
|
| Back to top |
|
 |
mak_tcs
New User

Joined: 23 Nov 2005 Posts: 69 Location: Minneapolis, MN USA
|
|
|
|
Please let me know if there is any alternate way of doing it.
Thanks,
Mak |
|
| Back to top |
|
 |
krisprems
Active Member

Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
mak_tcs
Alternative solution is
| Code: |
//STEP001 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
3400015.67;0000015.45;07/14/2007
/*
//TMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(TMP1) USING(CP01)
COPY FROM(TMP1) TO(OUT) USING(CP02)
/*
//CP01CNTL DD *
OUTREC BUILD=(1,7,9,10,20,13)
/*
//CP02CNTL DD *
INREC FIELDS=(1,9,ZD,SUB,11,09,ZD,EDIT=(IIIIIII.TT))
/*
|
OUT contains:
| Code: |
----+----1----+----2
3400000.22
|
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|