sorting data file (keeping header and trailer on same posi.)

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

Moderators: Frank Yaeger, Moderator Group

Post Reply
ravi10k
Member
Posts: 5
Joined: Tue Apr 21, 2009 1:38 pm

sorting data file (keeping header and trailer on same posi.)

Post by ravi10k » Fri Jan 29, 2010 6:46 pm

my requirement is like, I have a file below:

1.6.1.9.6?2. 196CIF2010028
500000000012 6196M1ACC00C
600000000007 5422239000000003
500000000013 6196M1ACC00C
600000000010 5422239000000052
500000000007 6196M1ACC00C
600000000012 5422231903255487
500000000010 6196M1ACC00C
600000000013 5422239000000078
600000000013 5422239000000078
600000000016 5408769000000007
500000000016 6196M2AGC00C
9.6.1.9.6?2. 196CIF0000073200


And I want the output file in sorted order on the basis on account number (position 2,length 11) and then record-type(position 1, length 1), keeping header and trailer records at the same position (i mean header on very first record and trailer on last record).

Please help.

ravi10k
Member
Posts: 5
Joined: Tue Apr 21, 2009 1:38 pm

Post by ravi10k » Fri Jan 29, 2010 6:49 pm

the output file would be like :

1.6.1.9.6?2. 196CIF2010028
500000000007 6196M1ACC00C
600000000007 5422239000000003
500000000010 6196M1ACC00C
600000000010 5422239000000052
500000000012 6196M1ACC00C
600000000012 5422231903255487
500000000013 6196M1ACC00C
600000000013 5422239000000078
600000000013 5422239000000078
500000000016 6196M2AGC00C
600000000016 5408769000000007
9.6.1.9.6?2. 196CIF0000073200

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

Post by Frank Yaeger » Fri Jan 29, 2010 8:56 pm

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code: Select all

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER TRAILER USING(CTL1)
/*
//CTL1CNTL DD *
  SORT FIELDS=(2,11,CH,A,1,1,CH,A)
/*
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

ravi10k
Member
Posts: 5
Joined: Tue Apr 21, 2009 1:38 pm

Post by ravi10k » Sat Jan 30, 2010 5:43 pm

Sorry Frank,
but we do not have ICETOOL installed in our system,

Could you please provide me the solution in normal DFSORT.

Thanks
Ravi

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 Feb 01, 2010 10:19 pm

we do not have ICETOOL installed in our system,
That statement makes no sense. If you have DFSORT installed, then you have DFSORT's ICETOOL. ICETOOL has been shipped with DFSORT since 1991! Did you actually try the job I posted? If it didn't work, you may be downlevel in DFSORT functional PTFs. See the following:

http://www.mainframegurukul.com/ibmmain ... php?t=3982
Could you please provide me the solution in normal DFSORT.
I did. ICETOOL is part of DFSORT.
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