Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Header with record statistics

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Ambili S

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Mon Sep 10, 2007 3:40 pm    Post subject: Header with record statistics
Reply with quote

Hi

I have an input file as given below.

Tot : 2
abcd
egfh

Tot : 3
pbcf
fgrn
sgfd

Now i want the output with a header of total records as 5 i.e it should be as given below.

Total no of records : 5

abcd
egfh
fgrn
pbcf
sgfd

The sum , count or any such statistics is working with TRAILER syntax but how do we get the same in HEADER . Can anybody let me know more on this.
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Mon Sep 10, 2007 3:59 pm    Post subject:
Reply with quote

Ambili,

Quote:
The sum , count or any such statistics is working with TRAILER syntax but how do we get the same in HEADER .

This require two passes. In first pass create HEADER record ALONE in a separte file (with trailer option). Concatenatee this file with your actual data.
Back to top
View user's profile Send private message
Ambili S

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Mon Sep 10, 2007 4:09 pm    Post subject:
Reply with quote

murmohk1 wrote:
Ambili,

Quote:
The sum , count or any such statistics is working with TRAILER syntax but how do we get the same in HEADER .

This require two passes. In first pass create HEADER record ALONE in a separte file (with trailer option). Concatenatee this file with your actual data.



Hi
I want the Total record count to appear in header. What should be the syntax to get the sum of both the total(i.e Tot : 2 and Tot : 3 )

.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Mon Sep 10, 2007 4:15 pm    Post subject:
Reply with quote

You put the count in a trailer, but make the trailer look like your header.
Then get that trailer into the header position.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Sep 10, 2007 8:41 pm    Post subject:
Reply with quote

Ambili,

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

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//SORTDIAG DD DUMMY
//IN DD *
Tot : 2
abcd
egfh

Tot : 3
pbcf
fgrn
sgfd
/*
//***> Use MOD data set for //OUT
//OUT DD DISP=MOD,DSN=...  output file
//TOOLIN   DD    *
COPY FROM(IN) USING(CTL1)
SORT FROM(IN) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  OMIT COND=(1,5,CH,EQ,C'Tot :',OR,1,5,CH,EQ,C' ')
  OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,
    TRAILER1=('Total no of records  :',COUNT=(M10,LENGTH=2),/)
/*
//CTL2CNTL DD *
  OMIT COND=(1,5,CH,EQ,C'Tot :',OR,1,5,CH,EQ,C' ')
  SORT FIELDS=(1,4,CH,A)
/*
Back to top
View user's profile Send private message
Ambili S

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Tue Sep 11, 2007 9:43 am    Post subject:
Reply with quote

Thanks Frank

It has worked . That was very much explanatory.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us