Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
rupa.srini

New User

Joined: 25 Nov 2008
Posts: 5
Location: Chennai

 Posted: Wed Feb 25, 2009 9:46 am    Post subject: How to get the Zoned Decimal format in Sum fields Hi, I am using the below sort SORT FIELDS=(1,1,CH,A) SUM FIELDS=(2,3,ZD) But I am not getting the output in Zoned decimal format,please find the output as below 1105 I expect my output as 110E ? Please help out. Thanks, Rupa.S

dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

 Posted: Wed Feb 25, 2009 10:49 am    Post subject: Hello, 1105 and 110E are both positive. Please post your sort control statements (if other than those already posted), a few data records, and the sum from them.
rupa.srini

New User

Joined: 25 Nov 2008
Posts: 5
Location: Chennai

Posted: Wed Feb 25, 2009 11:23 am    Post subject:

 Code: //GNC26708 EXEC  PGM=SORT      //***************************** //SYSOUT   DD SYSOUT=*          //SYSPRINT DD SYSOUT=*          //SORTIN   DD *                1 50                            1 55                            /*                              //SORTOUT  DD SYSOUT=*          //SYSIN    DD *                  INREC FIELDS=(1,1,C'0',3,2)    SORT FIELDS=(1,1,CH,A)          SUM FIELDS=(2,3,ZD)          /*

Though both are positive I want the output in ZD format i.e., 1505E.. but I am not getting it?
Frank Yaeger

DFSORT Moderator

Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

Posted: Wed Feb 25, 2009 9:05 pm    Post subject:

1105 is a valid ZD number as is 110E. One has an F sign, the other has a C sign. Both are valid signs for positive ZD numbers. However, if you want a C sign instead of an F sign, you can add the following to SYSIN:

 Code: OPTION NZDPRINT

NZDPRINT (C sign) will override your site's default of ZDPRINT (F sign).
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

Posted: Thu Feb 26, 2009 12:40 am    Post subject:

Hello,

I am obviously missing something. . .

How do these:
 Code: 1 50                            1 55
total this:
 Quote: Though both are positive I want the output in ZD format i.e., 1505E..
1505E equals 15,055. . .

50 + 55 would be 105 (or 10E), wouldn't it?
Frank Yaeger

DFSORT Moderator

Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

 Posted: Thu Feb 26, 2009 12:47 am    Post subject: For the given example, the result would be 1105 (with ZDPRINT) or 110E (with NZDPRINT). Since he's summing on 2,3, the '1' in the first position would be kept and the sum for 2,3 would be 105 or 10E. I ignored the statement about the result being 1505E and just showed how to get the desired sign.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am How to group and sum the decimal value sakrat DFSORT/ICETOOL 2 Tue Mar 06, 2018 9:13 pm Unloading DB2 table in CSV format alo... grvtomar COBOL Programming 7 Sun Jan 28, 2018 2:05 am Sum the fields in particular format f... sharana64 DFSORT/ICETOOL 9 Fri Jan 05, 2018 1:11 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us