JCL Sort Utility to Multiply 2 columns.

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
arunmoses2003
Member
Posts: 1
Joined: Tue Feb 28, 2012 11:35 am

JCL Sort Utility to Multiply 2 columns.

Post by arunmoses2003 » Tue Feb 28, 2012 11:48 am

Hey guys,

I need some help with this.I need a JCL Sort statement for the below scenario , I have 2 columns which have data as given below and i need to multiply them, i have been facing some issue with the difference in Data types.

Code: Select all

Column A		        Column B
  -1            		00000056.0700
  -7            		00000056.0700
  16            		00000550.0000
  16            		00000057.7300
  16            		00000057.7300
The first column has got negative values and the second column has got decimal values.
Any help on this will really be appreciated.

Thanks in advance!
Arun Moses

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Wed Feb 29, 2012 12:04 am

Here's a DFSORT job that will do what I think you're asking for:

Code: Select all

//S1 EXEC PGM=SORT                                  
//SYSOUT DD SYSOUT=*                                
//SORTIN DD *                                       
  -1                            00000056.0700       
  -7                            00000056.0700       
  16                            00000550.0000       
  16                            00000057.7300       
  16                            00000057.7300       
//SORTOUT DD SYSOUT=*                               
//SYSIN DD *                                        
  OPTION COPY                                       
  INREC OVERLAY=(51:1,4,FS,MUL,33,13,UFF,           
    EDIT=(STTTTTTTT.TTTT),SIGNS=(+,-))              
SORTOUT would have:

Code: Select all

  -1                            00000056.0700     -00000056.0700     
  -7                            00000056.0700     -00000392.4900     
  16                            00000550.0000     +00008800.0000     
  16                            00000057.7300     +00000923.6800     
  16                            00000057.7300     +00000923.6800     
If that's not what you want, then you need to explain/show more clearly what you do want.
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

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others