View previous topic :: View next topic
|
Author |
Message |
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
Hi ,
I have an input file like
Code: |
Apple A
Apple A
Apple B
Apple C
Orange A
Orange B
Orange C
Orange C
|
i am trying to get an Output like,
Code: |
Fruits Name Count
Apple A 2
Apple B 1
Apple C 1
Orange A 1
Orange B 1
Orange C 2
|
It would be great for your help.
Thanks |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
Back to top |
|
|
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
Hi Kolusu,
Thanks for your Manuals on Occur Operator.
It really helped out me.
How to get the total count with headings like below.
Code: |
Fruits Available
Month : July Year:2013
Fruits Name Count
Apple A 2
Apple B 1
Apple C 1
Orange A 1
Orange B 1
Orange C 2
Total 8
|
Below is my code
Code: |
OCCUR FROM(IN1) LIST(SORTOUT) -
TITLE(' Fruits Available ')-
HEADER('Fruits) ON(1,6,CH)-
HEADER('Name') ON(10,1,CH)-
HEADER('TOTAL') ON(VALCNT)-
BLANK
|
if i have more no of records in the input dataset its getting split into twp pages and gives the results.. what would be possibilities to get the results in Single page even if we have more no of records?
Thank you, |
|
Back to top |
|
|
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
is there any chances to get the Total count at the bottom with OCCUR operator? If yes please share the syntax
Thank you |
|
Back to top |
|
|
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
There is an Optional Operand "LINES" can be used , But i dont think i will work in OCCUR. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Generally the syntax is in the manual - you just have to read it and experiment. Also, generally, if the manual does not say that something can be done then it means that it cannot be done. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
shanth555 wrote: |
How to get the total count with headings like below.
Code: |
Fruits Available
Month : July Year:2013
Fruits Name Count
Apple A 2
Apple B 1
Apple C 1
Orange A 1
Orange B 1
Orange C 2
Total 8
|
|
Shanth555,
If you need the month name then you need to use FINDREP or CHANGE to convert the numeric month number into a Character Month name.
Quote: |
if i have more no of records in the input dataset its getting split into twp pages and gives the results.. what would be possibilities to get the results in Single page even if we have more no of records? |
What do you mean single page? If you have a million records in your input file and you end up with 2000 unique keys, how do you expect them to be fit in a single page? Do you mean you don't need the header on every single page? You just need the header once and the rest of the report doesn't have the header?
shanth555 wrote: |
is there any chances to get the Total count at the bottom with OCCUR operator? If yes please share the syntax |
If you looked at the syntax of OCCUR operator you would have noticed that you don't have TOTAL field.
If you are clear about the requirement , I would have suggested something else. You need to be clear with your requirements. If you wanted the total count of records at the end, then you will have to use REPORTING features (Sections and Trailerx) to get the desired results.
shanth555 wrote: |
There is an Optional Operand "LINES" can be used , But i dont think i will work in OCCUR. |
What makes you think it wouldn't work? If you have read upon the documentation about Lines you would have found this
DFSORT wrote: |
LINES(n) - Specifies the number of lines per page for the list data set (overriding the default of 58). n must be greater than 9, but less than 1000. |
|
|
Back to top |
|
|
|