Adding Trailer when comma or decimal point is involved

IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER
Aech
Posts: 11
Joined: Mon Mar 05, 2018 2:50 pm
Skillset: JCL , DFSORT, COBOL, REXX, StreamWeaver
Referer: Online

Adding Trailer when comma or decimal point is involved

Postby Aech » Thu Jul 12, 2018 3:23 pm

Hi,
So, I have been playing around the Header and Trailer options in OUTFIL. From what I could gather from the manuals is, if I have to take a total amount (or sum) of my data like below with a comma

Code: Select all

25,800 or 5,200


Then I would say in OUTFIL

Code: Select all

TOT=(01,6,PD,M12,LENGTH=10)


which should give me the result I require.

If I have a decimal point in my data like below

Code: Select all

66.00 or 3.55


Then I could say in OUTFIL as

Code: Select all

TOT=(01,4,BI,EDIT=(IIIIT))


which should give me what I want

But, what if my data looks like below with a mixture of both commas and decimal points

Code: Select all

1,100.15 or 10.00


Could you guys let me know if my required result is 1,110.15 then how can I achieve this. Do I have to reformat my data to remove the comma or decimal point ? or is there any way I would get a summation of the number with mixture of these symbols.

steve-myers
Global moderator
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Skillset: Assembler, JCL, utilities
Referer: zos.efglobe.com

Re: Adding Trailer when comma or decimal point is involved

Postby steve-myers » Thu Jul 12, 2018 6:36 pm

JCL is the control statements you use to direct the system to assign the resources required to run the programs required to perform the tasks you require.

JCL cannot manipulate your data in any way.

Based on your use of OUTFIL, I suspect this topic belongs in the DFSORT/ICETOOL/ICEGENER forum or the Syncsort/Synctool forum.

I will transfer this topic to the DFSORT forum for you. If you use Syncsort, you can transfer this topic to the Syncsort/Synctool forum yourself.

Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
Referer: other forum
Location: Dubuque, Iowa, USA

Re: Adding Trailer when comma or decimal point is involved

Postby Robert Sample » Thu Jul 12, 2018 7:55 pm

If you have a decimal point in addition to the commas, M18 instead of M12 should give you what you want.

Aech
Posts: 11
Joined: Mon Mar 05, 2018 2:50 pm
Skillset: JCL , DFSORT, COBOL, REXX, StreamWeaver
Referer: Online

Re: Adding Trailer when comma or decimal point is involved

Postby Aech » Mon Jul 16, 2018 9:03 pm

Thanks Robert, M18 worked as expected and I can see the desired results.

Much appreciated.

Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
Referer: other forum
Location: Dubuque, Iowa, USA

Re: Adding Trailer when comma or decimal point is involved

Postby Robert Sample » Mon Jul 16, 2018 9:18 pm

Glad to hear it worked.


  • Similar Topics
    Replies
    Views
    Last post