View previous topic :: View next topic
|
Author |
Message |
Tyler Dunbar
New User
Joined: 17 Jul 2017 Posts: 4 Location: NW Arkansas
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
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 |
|
|
Tyler Dunbar
New User
Joined: 17 Jul 2017 Posts: 4 Location: NW Arkansas
|
|
|
|
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 |
|
|
Tyler Dunbar
New User
Joined: 17 Jul 2017 Posts: 4 Location: NW Arkansas
|
|
|
|
I think I figured it out. Ran as DISP=(MOD,..) and it worked as expected. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
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 |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2018 Location: USA
|
|
|
|
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 |
|
|
|