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


     
 
MAINFRAME - TIP OF THE DAY : All available storage is assigned to the job or jobstep, If REGION is coded 0K or 0M

Google
 
Web mainframegurukul.com

Create New trailer with count as per the detail record type

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


Joined: 04 Sep 2011
Posts: 1
Location: Chennai

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Sun Sep 04, 2011 8:51 pm    Post subject: Create New trailer with count as per the detail record type Reply with quote

Hi ,

I have a requirement in which i have two types of detail record, i need to create a trailer with with the counts of each detail record and also the total count.

Original file :

1XXXXX22434
2XXXA dsfdaf gfgdfgh
2XXXA dsfdaf gfgdfgh
2XXXA dsfdaf gfgdfgh
2XXXA dsfdaf gfgdfgh
3XXXA dsfdaf gfgdfgh
3XXXA dsfdaf gfgdfgh
3XXXA dsfdaf gfgdfgh

Expected Output :

1XXXXX22434 --> Header
2XXXA dsfdaf gfgdfgh -->Detail record with indicator 2
2XXXA dsfdaf gfgdfgh
2XXXA dsfdaf gfgdfgh
2XXXA dsfdaf gfgdfgh
3XXXA dsfdaf gfgdfgh -->Detail record with indicator 3
3XXXA dsfdaf gfgdfgh
3XXXA dsfdaf gfgdfgh
4000000004000000003000000007 --- > trailer should start with 4


The trailer should have the count of each type ( type 2 and type 3)detail record separately and also the total count of the detail record (type2 +type 3).

Header record will start with 1,the first set of detail records with 2 , next set of detail records will start with 3 and the trailer will be 4.

I was able to bring the total count in the trailer.. but i am not sure about bringing the separate count as per the detail record.Could someone please help me with this.

Thanks!


Last edited by jaya1512 on Mon Sep 05, 2011 6:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

Frank Yaeger
Moderator


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

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Sep 07, 2011 12:51 am    Post subject: Reply with quote

You can use a DFSORT job like the following. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1XXXXX22434
2XXXA dsfdaf gfgdfgh
2XXXA dsfdaf gfgdfgh
2XXXA dsfdaf gfgdfgh
2XXXA dsfdaf gfgdfgh
3XXXA dsfdaf gfgdfgh
3XXXA dsfdaf gfgdfgh
3XXXA dsfdaf gfgdfgh
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'00')),
        IFTHEN=(WHEN=(1,1,CH,EQ,C'2'),OVERLAY=(81:C'1')),
        IFTHEN=(WHEN=(1,1,CH,EQ,C'3'),OVERLAY=(82:C'1'))
  OUTFIL REMOVECC,
    BUILD=(1,80),
    TRAILER1=('4',TOT=(81,1,ZD,TO=ZD,LENGTH=9),
                  TOT=(82,1,ZD,TO=ZD,LENGTH=9),
                  COUNT-1=(TO=ZD,LENGTH=9))
/*

_________________
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
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
sucho
Member


Joined: 11 Feb 2015
Posts: 1

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Feb 11, 2015 5:57 pm    Post subject: Write trailer having count of each gruop based on record key Reply with quote

Hello,

I have the following requirement -

Input file has the structure -
1 header(first 2 characters are '10'),
some detail records(first 2 characters act as KEY - '21', '22', '23', etc),
1 trailer(first 2 characters '90') - total count,count of key 1 records, count of key 2 records, count of key 3 records and so on.

I have to filter out all records that have 'JD' at a particular position(position depends on record key) and write the records to a new file and also update the counts in the trailer.

Input file
10APPLIDDMMYYYY
21ABC J
21ABC JD
21ABC J
22ABC J
22ABC J
22ABC JD
22ABC JD
23ABC JD
23ABC JD
23ABC J
90000000010000000003000000004000000003

Output file
10APPLIDDMMYYYY
21ABC JD
22ABC JD
22ABC JD
23ABC JD
23ABC JD
90000000005000000001000000002000000002

I have written the following sort card that filters out the desired records. But was unable to come up with a solution for the trailer -

OPTION COPY
INCLUDE COND=((1,2,CH,EQ,C'21',AND,9,2,CH,EQ,C'JD'),OR,
(1,2,CH,EQ,C'22',AND,7,2,CH,EQ,C'JD'),OR,
(1,2,CH,EQ,C'23',AND,12,2,CH,EQ,C'JD'),OR,
1,2,CH,EQ,C'10',OR,
1,2,CH,EQ,C'90')

Could you please suggest how I may modify the sort card for getting the new trailer with correct counts. I would prefer just DFSORT without ICETOOL.

Thanks,
Sucho
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
William Collins
Active Member


Joined: 24 May 2012
Posts: 714

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Feb 11, 2015 10:05 pm    Post subject: Reply with quote

You should ask as a new question, not continue an old topic. Have you looked at TRLUPD?
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
academyindia4
Guest





Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Jan 25, 2016 9:34 pm    Post subject: Topic deleted by Admin Reply with quote

<< Content deleted By Admin >>
Back to top
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
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 Search Batch file-aid help 14 frenchman 31561 Mon Feb 01, 2016 10:23 pm
academyindia4 View latest post
No new posts File-Aid Help 3 Nicholas 21374 Mon Feb 01, 2016 10:22 pm
academyindia4 View latest post
No new posts Hi plz help me out 7 Guest 21197 Mon Feb 01, 2016 10:14 pm
academyindia4 View latest post
No new posts Need urgent HELP 4 Sulagna 12528 Mon Feb 01, 2016 1:39 am
academyindia4 View latest post
This topic is locked: you cannot edit posts or make replies. executing java program thru JCL 6 Guest 24809 Tue Feb 12, 2013 1:56 pm
Anuj Dhawan 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-5960.html