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
 

 

Count the number of records in inputfile and write output fi

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

New User


Joined: 31 May 2005
Posts: 16

PostPosted: Thu Feb 19, 2009 10:33 am    Post subject: Count the number of records in inputfile and write output fi
Reply with quote

Hi,

I have a requirement to count the number of records in the input file and write to an output file.

The requirement is like i have 10 input datasets and the number of records in each dataset should be written as separate record in a single output file.

Kindly help me in this case!

Thanks and regards
Renjith
Back to top
View user's profile Send private message

renjithravi1
Warnings : 2

New User


Joined: 31 May 2005
Posts: 16

PostPosted: Thu Feb 19, 2009 11:38 am    Post subject:
Reply with quote

Hi,

I have already tried for one dataset by using the following code,

Code:

//S020        EXEC PGM=ICETOOL,     
//TOOLMSG DD   SYSOUT=*                                     
//DFSMSG   DD   SYSOUT=*                                 
//IN            DD 
//OUT         DD 
//TOOLIN    DD  *                                             
  COUNT FROM(IN) WRITE(OUT)                                 
/*             
                                             


But getting the error
Code:

            COUNT FROM(IN) WRITE(OUT)               
                           $                       
ICE604A 0 ERROR IN KEYWORD, PARAMETER, OR DELIMITER
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 992
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Feb 19, 2009 2:42 pm    Post subject:
Reply with quote

ICETOOL's COUNT will write the count to TOOLMSG.

What you could do is set TOOLMSG to a dataset and then select the lines with the information you need and format output records from those.

Garry.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2239
Location: @my desk

PostPosted: Thu Feb 19, 2009 2:49 pm    Post subject:
Reply with quote

Or even something like this.
Code:
//OUT        DD DSN=Output file,DISP=MOD
//TOOLIN     DD  *                                             
  COPY FROM(IN1) TO(OUT) USING(CTL1)                                 
  COPY FROM(IN2) TO(OUT) USING(CTL1)
......
......
//CTL1CNTL   DD *
  OPTION COPY
  OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,TRAILER1=(COUNT)
Back to top
View user's profile Send private message
renjithravi1
Warnings : 2

New User


Joined: 31 May 2005
Posts: 16

PostPosted: Thu Feb 19, 2009 4:48 pm    Post subject: Reply to: Count the number of records in inputfile and write
Reply with quote

Hi,

Thanks you very much for the answer. I have tried and it has been working. But i have one more requirement of print a certain text also with the number of records like,

FILE100010
FILE200012

Is is possible in ICETOOL?

Thanks and regards
Renjith
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: Thu Feb 19, 2009 10:21 pm    Post subject:
Reply with quote

The error message for:

Code:

 COUNT FROM(IN) WRITE(OUT)


indicates that you don't have z/OS DFSORT V1R5 PTF UK90013 (July, 2008) installed. You need that PTF to use the WRITE function. Ask your System Programmer to install the PTF (it's free).

Once you have that PTF installed, you can do what you want using a DFSORT/ICETOOL job like this:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1
//IN2 DD DSN=...  input file1
...
//IN10 DD DSN=...  input file10
//CT1 DD DSN=...   output file1
//CT2 DD DSN=...   output file2
...
//CT10 DD DSN=...  output file10
//TOOLIN DD *
COUNT FROM(IN1) TEXT('FILE1') WRITE(CT1) DIGITS(5)
COUNT FROM(IN2) TEXT('FILE2') WRITE(CT2) DIGITS(5)
...
COUNT FROM(IN10) TEXT('FILE10') WRITE(CT10) DIGITS(5)
/*


Alternatively, you could do it with this DFSORT/ICETOOL job that doesn't require the PTF:

Code:

//S2   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1
//IN2 DD DSN=...  input file1
...
//IN10 DD DSN=...  input file10
//CT1 DD DSN=...   output file1
//CT2 DD DSN=...   output file2
...
//CT10 DD DSN=...  output file10
//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN2) USING(CTL2)
...
COPY FROM(IN10) USING(CTLA)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=CT1,REMOVECC,NODETAIL,
    TRAILER1=('FILE1',COUNT=(EDIT=(TTTTT)))
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=CT2,REMOVECC,NODETAIL,
    TRAILER1=('FILE2',COUNT=(EDIT=(TTTTT)))
/*
...
//CTLACNTL DD *
  OUTFIL FNAMES=CT10,REMOVECC,NODETAIL,
    TRAILER1=('FILE10',COUNT=(EDIT=(TTTTT)))
/*
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 Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 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 what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am


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