IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Header with record statistics


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1436
Location: Bangalore,India

PostPosted: Mon Sep 10, 2007 3:59 pm
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
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: 2146
Location: At my coffee table

PostPosted: Mon Sep 10, 2007 4:15 pm
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 Developer


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

PostPosted: Mon Sep 10, 2007 8:41 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top