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

Count From Multiple Inputs


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Tyler Dunbar

New User


Joined: 17 Jul 2017
Posts: 4
Location: NW Arkansas

PostPosted: Tue Nov 12, 2019 1:07 am
Reply with quote

Im just trying to run a job from adhoc file counts but its only showing the last count statement in my output file. What am I missing?

Code:

//STEP02   EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//F3A      DD DSN=DSN1,DISP=SHR   
//F3C      DD DSN=DSN2,DISP=SHR   
//F3K      DD DSN=DSN3,DISP=SHR   
//OUT      DD DSN=DSNOUT,                   
//            DISP=(,CATLG,DELETE),                             
//            DCB=(LRECL=80,RECFM=FB),                           
//            SPACE=(CYL,(10,10),RLSE)                           
//TOOLIN   DD *                                                 
 COUNT FROM(F3A) WRITE(OUT) EDCOUNT(U08) TEXT('F3A COUNT: ')     
 COUNT FROM(F3C) WRITE(OUT) EDCOUNT(U08) TEXT('F3C COUNT: ')     
 COUNT FROM(F3K) WRITE(OUT) EDCOUNT(U08) TEXT('F3K COUNT: ')       
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2569
Location: NYC,USA

PostPosted: Tue Nov 12, 2019 1:22 am
Reply with quote

Are you getting different result than this?
Code:
//STEP02   EXEC PGM=ICETOOL                                 
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//F3A      DD *                                             
4                                                           
4                                                           
//F3B      DD *                                             
4                                                           
//F3C      DD *                                             
4                                                           
4                                                           
4                                                           
4                                                           
4                                                           
//OUT      DD SYSOUT=*                                     
//TOOLIN   DD *                                             
 COUNT FROM(F3A) WRITE(OUT) EDCOUNT(U08) TEXT('F3A COUNT: ')
 COUNT FROM(F3B) WRITE(OUT) EDCOUNT(U08) TEXT('F3B COUNT: ')
 COUNT FROM(F3C) WRITE(OUT) EDCOUNT(U08) TEXT('F3C COUNT: ')


Output
Code:
********************************* TOP OF DATA **
F3A COUNT:         2                           
F3B COUNT:         1                           
F3C COUNT:         5                           
******************************** BOTTOM OF DATA


EDIT : OK, When I provide Output Dataset I only get the last one as mentioned by you. May be you can't and need 3 different WRITE names and merge then to combine.
Back to top
View user's profile Send private message
Tyler Dunbar

New User


Joined: 17 Jul 2017
Posts: 4
Location: NW Arkansas

PostPosted: Tue Nov 12, 2019 1:28 am
Reply with quote

Yes, its only writing the last count statement to file. So either my OP allocation is wrong and its just overwriting on same line or Ive done something else wrong.
If I write to sysout like you did, it works correctly.

Code:

***************************** Top of Data ******
F3C COUNT:         6                           
**************************** Bottom of Data ****
Back to top
View user's profile Send private message
Tyler Dunbar

New User


Joined: 17 Jul 2017
Posts: 4
Location: NW Arkansas

PostPosted: Tue Nov 12, 2019 1:36 am
Reply with quote

I think I figured it out. Ran as DISP=(MOD,..) and it worked as expected.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2569
Location: NYC,USA

PostPosted: Tue Nov 12, 2019 3:36 am
Reply with quote

Tyler Dunbar wrote:
I think I figured it out. Ran as DISP=(MOD,..) and it worked as expected.

Only thing to note is it will keep appending as your submit more and more.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 925
Location: Maryland

PostPosted: Tue Nov 12, 2019 10:34 pm
Reply with quote

Everything is absolutely correct in this topic except one thing: the question itself is not related neither to SORT, nor to COUNT.

The question is related to pure JCL, and the question is: "How to accumulate multiple data results in the same dataset, without overriding previous data?"

BTW: if (for testing purposes) the output dataset is replaced with // DD SYSOUT=*, then DISP=MOD is used by default!
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 Record count of RECFM=U tape file DFSORT/ICETOOL 17
No new posts how to get total count from numeric d... SYNCSORT 9
No new posts Creating a single-record file with CO... DFSORT/ICETOOL 8
No new posts Read 4MB message and split into multi... COBOL Programming 9
No new posts Multiple Sums in one File SYNCSORT 2
Search our Forums:

Back to Top