How to use sum fields for this case?



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

How to use sum fields for this case?

Postby uday123 » Sun Nov 28, 2010 3:16 am

I have some records , which have data in this format.

450010002001234N
450029999005678}
450022843949237{

i want to add last 5 digits of each record.

In first record N means -5 shud be taken for calculation
} means + 0 and { means - 0 shud be taken.


Please advise , hw we can do this using SUM FIELDS option or any other procedure.
Any way we can do the conversion automatically? like N means -5 ?? because when i edit the data set in FILE AID , it converts automatically and shows N as 5.

Please advice. Thanks.
uday123
 
Posts: 29
Joined: Fri Feb 06, 2009 6:13 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to use sum fields for this case?

Postby dick scherrer » Sun Nov 28, 2010 9:37 am

Hello,

Just define this field as ZD (zoned-decimal) and the sort will do what you have asked for.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to use sum fields for this case?

Postby uday123 » Mon Nov 29, 2010 1:33 am

Hi Dick ,

Thanks for your reply..
Could you please give me the sort card how to do conversion from EBCDIC to ZD , as i did not find it anywhere? Or link to that also wud help me.
After tat i will sum up the ZD fields. Thanks

Regards
Uday
uday123
 
Posts: 29
Joined: Fri Feb 06, 2009 6:13 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to use sum fields for this case?

Postby dick scherrer » Mon Nov 29, 2010 6:26 am

Hello,

There is no conversion needed. All that is needed is the proper definition as the data posted is zoned-decimal.

Modify this for your use:
SUM FIELDS=(start,end,ZD)
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to use sum fields for this case?

Postby uday123 » Mon Nov 29, 2010 10:19 pm

Thanks Dick, how ever i have another problem here ..


I need to merge two files , side by side

Input 1 : 23456 6789
Input 2 : 63639

O/p : 23456 6789 63639

Please advise or help me out by providing link to the same. Thanks.
uday123
 
Posts: 29
Joined: Fri Feb 06, 2009 6:13 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to use sum fields for this case?

Postby dick scherrer » Tue Nov 30, 2010 1:53 am

Hello,

Is DFSORT used on your system (the top of the output from an execution will show which sort product is in use) or Syncsort or ?

I seem to recall this being originally posted in the JCL part of the forum?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to use sum fields for this case?

Postby Frank Yaeger » Tue Nov 30, 2010 2:22 am

uday123,

Does each input file only have one record? If not, show a better example with multiple records in each input file.

What is the RECFM and LRECL of the input files? What is the expected RECFM and LRECL of the output file? What is the starting position, length and format of each relevant field? What are the rules for joining the records - is it record-by-record (F1R1 with F2R1, F1R2 with F2R2, etc) or something else?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post