Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : When you use COUNT operator to set a return code of 12 or 4 if a specified data set is EMPTY, NOTEMPTY, HIGHER(n), LOWER(n), EQUAL(n) or NOTEQUAL(n). where n is a specified number of records. If you use the RC4 operand, SORT sets RC=4; otherwise it sets RC=12. E.g. COUNT FROM(IN) EMPTY

Google
 
Web mainframegurukul.com

Splitting of File using Icetool

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
Assassin
Member


Joined: 12 May 2011
Posts: 2

PostPosted: Thu May 12, 2011 8:20 pm    Post subject: Splitting of File using Icetool Reply with quote

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
Back to top
View user's profile Send private message

dbzTHEdinosauer
Moderator


Joined: 02 Oct 2006
Posts: 939

PostPosted: Thu May 12, 2011 8:38 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Assassin
Member


Joined: 12 May 2011
Posts: 2

PostPosted: Thu May 12, 2011 9:39 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

PostPosted: Fri May 13, 2011 9:12 pm    Post subject: Reply with quote

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:

//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?rs=114&uid=isg3T7000242
_________________
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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts Need to put records a Sorting order as mentioned below. 13 Yash1911 1786 Wed Oct 31, 2012 8:18 pm
dbzTHEdinosauer View latest post
No new posts how to deal with the below scenario using iebgener 7 mainframes_6002 2656 Wed Dec 07, 2011 10:34 am
DikDude View latest post
No new posts Coulu someone explain the parameters in the below code? 1 lovely sweety 5096 Thu Jun 09, 2011 3:50 pm
dbzTHEdinosauer View latest post
No new posts Unable to achieve below scenario using ICETOOL 24 sirianangel 15951 Sat Oct 23, 2010 12:45 am
Frank Yaeger View latest post
No new posts Query For IEBPTPCH 2 padmajeet.gaikwad 6990 Mon Oct 26, 2009 10:25 am
padmajeet.gaikwad View latest post
 





Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-5796.html