View previous topic :: View next topic
|
Author |
Message |
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
Hi,
Could anyone please help me in the following requirement.
I have a file with the following records
Field1 Field2
------ ------
234 trwtooo
234 prwtroo
234 yiirueur
567 grsgdgd
567 gedsgdf
567 gdgsgsg
567 gdsgsgs
668 gdfgfdg
I need to get the count of records based on field1
My output should be like
field1 count
------ ------
234 3
567 4
668 1
Thanks in advance for all the help
Thanks,
Dharani |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT DD SYSOUT=*
//TOOLIN DD *
OCCUR FROM(IN) LIST(OUT) BLANK -
HEADER('Field1') ON(1,3,CH) -
HEADER('Count') ON(VALCNT,U06)
/*
|
|
|
Back to top |
|
|
mukunthg
New User
Joined: 27 Mar 2007 Posts: 10 Location: India
|
|
|
|
Could you please explain what LIST and BLANK will do?
Thanks,
Mukunth,G |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
From "z/OS DFSORT Application Programming Guide":
LIST(listdd)
Specifies the ddname of the list data set to be produced by ICETOOL for this operation. A listdd DD statement must be present.
BLANK
Specifies an alternate format for printing character and numeric data as follows:
Numeric values for which formatting is not specified are printed with blank for plus sign, - for minus sign and no leading zeros (overriding the default of + for plus sign and leading zeros).
Column widths are dynamically adjusted according to the length of the headings and the maximum number of bytes needed for the character or numeric data
Headings and data for numeric fields are right-justified (overriding the default of left-justified headings and data for numeric fields)
You can access all of the DFSORT books from:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|