Thank you. DFSORT does not have a problem with SUBDAYS function. It is the version of DFSORT on your system that you are running. Looks like your System does NOT have the PTF H which supports date arithmetic. Your last sysout chopped off the message code. The message ICE201I in the SYSOUT should have H next to it to support the date arithmetic function. Ask your System Programmer to install it (it's free).
ICE201I H RECORD TYPE ...
the H indicates you have the October, 2010 DFSORT functions (RESIZE, IFTRAIL, ACCEPT, ADDDAYS, DATEDIFF, TRAN=ATOE, KEYBEGIN, etc) and all of the earlier functions. This function level corresponds to z/OS DFSORT V1R10 PTF UK90025 and z/OS DFSORT V1R12 PTF UK90026. You are completely up to date on DFSORT functional PTFs.
ICE201I G RECORD TYPE ...
the G indicates you have the November, 2009 DFSORT functions (JOINKEYS, TOJUL, TOGREG, WEEKDAY, etc) and all of the earlier functions. This function level corresponds to z/OS DFSORT V1R5 PTF UK51706 and z/OS DFSORT V1R10 PTF UK51707. You are behind on DFSORT functional PTFs. Ask your System Programmer to install z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026.
ICE201I F RECORD TYPE ... then you need to code a program.
I translated the positive(+) to -1 in Packed decimal format and negative (-) to +1 in packed decimal format using findrep.
*Sigh* It is really difficult to provide solutions with moving target. within a span of 5 posts the positions of the date fields crawled 5 bytes more?
Also I realized that with positive offsets , the date needs to incremented in case the calculated seconds exceeds 86399 (24 hours = 86400 seconds)
Use the following DFSORT control cards which will give you the desired results.
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(275:52,1,SFF,ZD,LENGTH=1)),
IFTHEN=(WHEN=INIT,
FINDREP=(STARTPOS=275,INOUT=(X'F0',X'1D',X'D0',X'1C'))),
IFTHEN=(WHEN=INIT,
OVERLAY=(276:(40,2,ZD,MUL,+3600,ADD,43,2,ZD,MUL,+60,ADD,46,2,ZD),
SUB,((53,2,ZD,MUL,+3600,ADD,56,2,ZD,MUL,+60),MUL,275,1,PD),
ZD,LENGTH=8)),
IFTHEN=(WHEN=(276,8,ZD,LE,0),
OVERLAY=(276:276,8,ZD,ADD,+86400,ZD,LENGTH=8,
284:29,10,UFF,M11,LENGTH=8,
292:284,8,Y4T,TOJUL=Y4T,
296:296,3,ZD,SUB,+1,EDIT=(TTT),C'P'),HIT=NEXT),
IFTHEN=(WHEN=(299,1,CH,EQ,C'P',AND,296,3,ZD,GT,0),
OVERLAY=(029:292,7,Y4T,TOGREG=Y4T(-))),
IFTHEN=(WHEN=(299,1,CH,EQ,C'P',AND,34,5,CH,EQ,C'01-01'),
OVERLAY=(029:292,4,ZD,SUB,+1,EDIT=(TTTT),C'-12-31')),
IFTHEN=(WHEN=(276,8,ZD,GT,86399),
OVERLAY=(276:276,8,ZD,SUB,+86400,ZD,LENGTH=8,
284:29,10,UFF,M11,LENGTH=8,
292:284,8,Y4T,TOJUL=Y4T,
296:296,3,ZD,ADD,+1,EDIT=(TTT),C'N'),HIT=NEXT),
IFTHEN=(WHEN=(299,1,CH,EQ,C'N',AND,34,5,CH,EQ,C'12-31'),
OVERLAY=(029:292,4,ZD,ADD,+1,EDIT=(TTTT),C'-01-01',299:C' ')),
IFTHEN=(WHEN=(299,1,CH,EQ,C'N',AND,34,5,CH,NE,C'12-31'),
OVERLAY=(029:292,7,Y4T,TOGREG=Y4T(-)))
OUTREC IFOUTLEN=274,IFTHEN=(WHEN=INIT,
OVERLAY=(40:276,8,ZD,DIV,+3600,EDIT=(TT),
43:(276,8,ZD,MOD,+3600),DIV,+60,EDIT=(TT),
46:((276,8,ZD,MOD,+3600),MOD,+60),EDIT=(TT)))
//*