Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Addition of packed decimal using SORT jcl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rosmi joseph

New User


Joined: 17 Sep 2007
Posts: 68
Location: Kochi

PostPosted: Tue Nov 20, 2007 9:30 am    Post subject: Addition of packed decimal using SORT jcl
Reply with quote

Hi,

I have two input files with s9(11)v9999 COMP-3 variables.
I have to sum up both the numbers are write it to the SORT out file.

Record format: FB
Record length: 80

Both the numbers are at the first postion in both the files.

Please let me know how to do this using JCL sort.

Thanks.
Back to top
View user's profile Send private message

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Tue Nov 20, 2007 11:28 am    Post subject: Reply to: Addition of packed decimal using SORT jcl
Reply with quote

rosmi,

Quote:
Please let me know how to do this using JCL sort.


You can use DFSORT for your requirement. DFSORT has many ways to edit a PD field using the edit masks available (M0 - M26).

First convert the PD fields to the required format and then do the arithmetic operation on that.
Back to top
View user's profile Send private message
rosmi joseph

New User


Joined: 17 Sep 2007
Posts: 68
Location: Kochi

PostPosted: Tue Nov 20, 2007 11:37 am    Post subject:
Reply with quote

Hi,

I am not sure abt the syntax. Could anyone please assist me.

Thanks.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Nov 20, 2007 4:08 pm    Post subject:
Reply with quote

rosmi joseph

SORT JCL for your requirement is as follows
Code:
//*******************************************************
//STEP1    EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD I/P-FILE-1 (FB/80)                         
//         DD I/P-FILE-2 (FB/80)                         
//SORTOUT  DD O/P-FILE (FB/80)                           
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                       
  OUTFIL REMOVECC,NODETAIL,                             
         TRAILER1=(1:TOT=(1,8,PD,TO=PD))                 
/*                                                       


If you want the i/p file records in your o/p then remove NODETAIL from the OUTFIL statement.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Nov 20, 2007 9:38 pm    Post subject:
Reply with quote

rosmi joseph,

Note that Krisprems DFSORT job will produce an 8-byte PD total. If you want the total in a displayable form you can use DFSORT edit masks, e.g.

TRAILER1=(TOT=(1,8,PD,M10))

would give you a 15-digit total with leading zeros suppressed, e,g.

Code:

         112344


For more information on using DFSORT edit masks, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.4.8?DT=20060615173822

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us