Splitting of File using Icetool

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

Moderators: Frank Yaeger, Moderator Group

Post Reply
Assassin
Member
Posts: 2
Joined: Thu May 12, 2011 7:25 pm

Splitting of File using Icetool

Post by Assassin » Thu May 12, 2011 8:20 pm

We have 1 file with header and trailer records. We have to Split this file such that:
a) Both files will have same header as obtained from input file
b) Both files will have same trailer as obtained from input file except the count of records present in newly created files.
c) Data records will be splitted based on 3 characters represented as XXX in sample data given below(records having XXX = 008
needs to be in one file and rest in other file).

I am able to copy header,trailer and split data records but not able to update the count of records in trailer . Moreover I don't think I created an optimised Icetool.

File properties are FB,LRECL=40

Sample Data in file is :

14X'00'ABCDEFGHIJK20110207 (Header)
12345678912345XXXO
68663647346764XXXO
93619719469696XXXO
69696696696996XXXO
.
.
.
12340010585858XXXO
14X'FF'ABCDEFGHIJK0000047723 (Trailer)


* Here initial 14 characters in Header are Low values X'00'
* initial 14 characters in trailer are High values X'FF'
* XXX(alphanumeric) are the 3 characters based on which split will occur starting from 15th position.
* Last 10 digits in trailer represent count starting from 26th position.

Please can somebody help me out by providing solution to my problem. Thanks

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Thu May 12, 2011 8:38 pm

why don't you start by:
  • showing us your control cards
  • provide a more realistic input file
  • provide a precise expected output
  • tell us what is/how is the 'split' indicator determined? - we know where the comparision is to take place, just don't know with what.
you may know what you need, but you have not really explained it to us.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Assassin
Member
Posts: 2
Joined: Thu May 12, 2011 7:25 pm

Post by Assassin » Thu May 12, 2011 9:39 pm

provide a more realistic input file:
This is the realistic file as mentioned in my original post containing:
a) Header: first 14 characs as Low value then next 11 characs are system name and at the end 10 numeric digits containing business date
b) Trailer: first 14 characs as Low value then next 11 characs are system name and at the end 10 numeric digits showing count of main data records in file.
c) Data records: First 14 numeric digits containing account branch info then next 3 characs(doc type) based on which files will be splitted into 2 output files then at the end 1 charac representing a constant


provide a precise expected output

Two files with exactly same format as of input file,
a) same header values in both files, as in input file
b) Same trailer values in both files except the count of main data records obtained in respective file after splitting.
c) Data records in one file for doc type = 008 and in other all other records

tell us what is/how is the 'split' indicator determined? - we know where the comparision is to take place, just don't know with what

May be I have confused you by my earlier post, by split I meant just that one output file will have data records based on doc type =008(alphanumeric data) and other file with data records with other doc type. So we can simply copy records in respective output files by using Include or Omit condition.
I used 15,3,CH,EQ,'008'. (its working)

Hope I have clarified your queries a bit to enable you finding solution to my problem

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 May 13, 2011 9:12 pm

Here's a DFSORT job that will do what you asked for using DFSORT's new IFTRAIL function available with the Oct, 2010 PTF. I assumed X'FF's in positions1-5 were enough to identify the trailer.

Code: Select all

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//OUT1 DD DSN=...    output file1
//OUT2 DD DSN=...    output file2
//SYSIN DD *
  OPTION COPY
  OUTFIL FNAMES=OUT1,
    INCLUDE=(15,3,CH,EQ,C'008'),
    IFTRAIL=(HD=YES,TRLID=(1,5,BI,EQ,X'FFFFFFFFFF'),
      TRLUPD=(26:COUNT=(M11,LENGTH=10)))
  OUTFIL FNAMES=OUT2,
    INCLUDE=(15,3,CH,NE,C'008'),
    IFTRAIL=(HD=YES,TRLID=(1,5,BI,EQ,X'FFFFFFFFFF'),
      TRLUPD=(26:COUNT=(M11,LENGTH=10)))
/*
For more information on the Oct, 2010 DFSORT PTF,see:

http://www.ibm.com/support/docview.wss? ... g3T7000242
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 9:58 pm

<< 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