Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Count From Multiple Inputs

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Count From Multiple Inputs
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

Senior Member


Joined: 21 Sep 2010
Posts: 2310
Location: NY,USA

PostPosted: Tue Nov 12, 2019 1:22 am    Post subject:
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    Post subject:
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    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 2310
Location: NY,USA

PostPosted: Tue Nov 12, 2019 3:36 am    Post subject:
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: 632
Location: Maryland

PostPosted: Tue Nov 12, 2019 10:34 pm    Post subject:
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    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 Is multiple program names allowed in ... Sakthidevi PL/I & Assembler 1 Tue Nov 19, 2019 11:12 pm
No new posts Is possible to concatenate multiple P... Poha Eater DFSORT/ICETOOL 6 Fri Aug 02, 2019 1:21 pm
No new posts How to count duplicate key records co... sergeyken SYNCSORT 0 Thu Jul 25, 2019 8:03 pm
No new posts No of job count for an milestone job sen_1983us CLIST & REXX 7 Tue Jul 02, 2019 7:34 am
No new posts Mainframe to linux file count mismatch shreya19 All Other Mainframe Topics 4 Thu Jun 13, 2019 9:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us