Reg DFSORT utility.

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

Moderators: Frank Yaeger, Moderator Group

Post Reply
ursvmg
Member
Posts: 3
Joined: Tue Jan 16, 2007 3:26 am

Reg DFSORT utility.

Post by ursvmg » Tue Jan 16, 2007 5:50 am

Hi All,

I'm new to this mainframe ocean. I'm in a maintenance project.

I'm facing one problem in DFSORT utility. My JCL uses this utility to count the number of records in the input file and to create a trailer record depending on the number of records in the inpt file.

Here are the parameters it uses:

Code: Select all

   MERGE   FIELDS=(2,16,CH,A)     
   INREC   FIELDS=(17C'9',C'000000010') 
   SUM     FIELDS=(18,9,ZD)          
   OUTREC  FIELDS=(1,25,16C'0',224X) 
The problem is, when the input file is empty, its not creating the output trailer record.

The output (trailer record) if there are some number of files in input will look like,
99999999999999999000006020000000000000000

where 602 is the no of records in the input file.
For an empty input, its not creating the output like
99999999999999999000000000000000000000000,
instead it is creating an empty output.

How can i overcome this problem.? Can anyone help me out.........?

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 Jan 16, 2007 10:12 pm

That's a very indirect way to get a trailer record with the count, and the way it's set up it won't give you any output records when there are no input records. You can use the more direct method of using DFSORT's TRAILER1 and COUNT parameters, which will give you a record with a count of 0 when there are no input records. Here's a DFSORT job that will do what you asked for:

Code: Select all

//S1 EXEC PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
   OPTION COPY
   INREC   FIELDS=(265X)
   OUTFIL REMOVECC,NODETAIL,
     TRAILER1=(17C'9',COUNT=(M11,LENGTH=8),16C'0')
/*
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

ursvmg
Member
Posts: 3
Joined: Tue Jan 16, 2007 3:26 am

Thanks yaar

Post by ursvmg » Wed Jan 17, 2007 3:15 am

Hi Frank,
Thanks a lot for ur assistance. The link u provided is excellent. Also the piece of code.
Once again thanks a lot.

Regards,
Gobalakrishnan M

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 Jan 17, 2007 3:17 am

Glad I could help.
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

academyindia4

Topic deleted by Admin

Post by academyindia4 » Mon Jan 25, 2016 11:00 pm

<< Content deleted By Admin >>

academyindia4

Topic deleted by Admin

Post by academyindia4 » Mon Feb 01, 2016 1:38 am

<< Content deleted By Admin >>

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