addition of records using sort

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

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

Post by Frank Yaeger » Mon Jun 29, 2009 7:54 pm

Please show your expected output records.

Also, what is the RECFM and LRECL of your input file.
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

pradeepa
Member
Posts: 16
Joined: Tue Jun 02, 2009 5:10 pm
Location: chennai

Post by pradeepa » Tue Jun 30, 2009 11:22 am

Hi,

my expected output file is:

100
200
300
Total number of records:03
Addition of these records:600

and RECFM is FB and LRECL=80 for both input and output file.
please help me in this.
pradeepa

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

Post by Frank Yaeger » Tue Jun 30, 2009 8:07 pm

You can use a DFSORT job like the following to do what you asked for:

Code: Select all

//S1    EXEC  PGM=ICEMAN
//SYSOUT DD  SYSOUT=*
//SORTIN DD *
asdskdskd   100 adklda
lsdlsladlds 200 jkdadd
ffgfgfgfgfg 300 fgkflglf
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD    *
  OPTION COPY
  INREC BUILD=(13,3,80:X)
  OUTFIL REMOVECC,
    TRAILER1=('Total number of records: ',COUNT=(EDIT=(TT)),/,
      'Addition of these records: ',TOT=(1,3,ZD,EDIT=(TTT)))
/*
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/sof ... tmpub.html
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

pradeepa
Member
Posts: 16
Joined: Tue Jun 02, 2009 5:10 pm
Location: chennai

Post by pradeepa » Wed Jul 01, 2009 5:44 pm

thank u
pradeepa

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