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
 

 

How to calculate Record count

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

New User


Joined: 06 Dec 2006
Posts: 1
Location: Trivandrum

PostPosted: Wed Dec 06, 2006 3:39 pm    Post subject: How to calculate Record count
Reply with quote

Hi,

We are trying to calculate the record count.

The current situation is that we are generating the trailer in the sort control card and it is apended to the file at the bottom, but the trailer TOT parameter will have the count upto the previous record read only i.e the trailer record is not added to the count.

We need to include this trailer record also in the total count..can we have it done in the same control card .

Currently we have coded the control card as:
Code:

   SORT FIELDS=(44,20,CH,A)                                 
   SUM FIELDS=NONE                                         
   INREC FIELDS=(1,500,C'1')                               
   OUTFIL REMOVECC,                                         
   TRAILER1=(1:C'TRLHSA',7:TOT=(501,1,ZD,EDIT=(TTTTTTTTT)),
          16:C'065',19:482X)   


But now we need to include the trailer record as well , how can we do that in the same control card.

Thanks,
Johndee.
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: Wed Dec 06, 2006 10:21 pm    Post subject:
Reply with quote

You don't need to use TOT to total up 1's to get the count. DFSORT has a COUNT parameter for that. And you can even use COUNT+1 to get the count of the data records + 1 for the trailer record. You can do it like this:

Code:

  INREC FIELDS=(1,500)    <---- if needed
  SORT FIELDS=(44,20,CH,A)                               
  SUM FIELDS=NONE                                       
  OUTFIL REMOVECC,                                       
   TRAILER1=(1:C'TRLHSA',7:COUNT+1=(EDIT=(TTTTTTTTT)),   
        16:C'065',19:482X)                               
Back to top
View user's profile Send private message
diwansk

New User


Joined: 01 May 2005
Posts: 4
Location: Bangalore

PostPosted: Tue Feb 20, 2007 7:29 pm    Post subject: Re: How to calculate Record count
Reply with quote

I have one more query on this. Can the record count be a variable field. In the example given above, the count will be written to a field of length 7 so if the rec count is 1600 it will come as 0001600. I dont leading zeros, is it possible using Sort ?
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: Tue Feb 20, 2007 9:29 pm    Post subject:
Reply with quote

You can display blanks instead of leading zeros by using:

COUNT+1=(EDIT=(IIIIIIIIT)

Note that the count will still be 7 characters but it will not have the leading zeros.

If you're asking if you can change the length of the count based on omitting leading zeros (e.g. a length of 4 for 1600 and a length of 7 for 1234567), there are no built-in functions for that.
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 Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm


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