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: 3051
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: 3051
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

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top