duplicate records count



Unicenter CA-Easytrieve Plus Report Generator: CA's information retrieval and data management tool

duplicate records count

Postby meena » Sat Oct 22, 2011 8:16 pm

hi all
my i/p file looks like:
5eeeeeeeeeee 111010
6sthyjdtbbk888888kkkkkkkk
6dfuyhhhhhhhhhhhhhhhhhhhhh
6 tfxbvyhfjguifyoyioiui
54444444444444444 111010
6sdysryhrsj
5222222222222 110909
5rrrrrrrrrrr 110909
5fdddddd 111212

v shld arrang date col of rows starting with '5' and count of similar dates shld be displayed aside.
my o\p shuld looks lik:
111010 2
110909 2
111212 1


my report prt is:
report.......
sequence ws-date
control ws-date
heading..
titile..
line..

but my o/p looks like;
111010

111010 2
110909

110909 2
111212
111212 1


what shld i do.......
meena
 
Posts: 11
Joined: Sat Oct 22, 2011 11:59 am
Has thanked: 0 time
Been thanked: 0 time

Re: duplicate records count

Postby BillyBoyo » Sat Oct 22, 2011 9:29 pm

You haven't shown us any data definitions or code. Since your report dates are not sequenced, I guess WS-DATE is not getting set correctly.
We also need to see your report definition.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: duplicate records count

Postby meena » Sat Oct 22, 2011 9:55 pm

hi billyboyo,
in records starting with '5' the date fields will be located in col 70-75......


i think its set in ws-date but
my o/p looks like

111010

111010 2
110909

110909 2
111212
111212 1
which means for the date 111010 which occurs 2 times so it prints one time,one space gives total in 3rd line ll'ly for other dates happening......i just want to neglect space and print once along with total.....


my code looks lik tis:
FILE INFILE
IN-REC 1 80 A
in-part1 1 1 n
in-part2 2 68 a
in-part3 70 6 n
in-part4 76 4 a

ws-part1 w 1 n
ws-part3 w 6 n
JOB INPUT infile

move in-part1 to ws-part1
if ws-part1=5
print
go to job
else
go to job
end-if


report .......
sequence in-part3
control in-part3
heading..
title..
line in-part3 tally
meena
 
Posts: 11
Joined: Sat Oct 22, 2011 11:59 am
Has thanked: 0 time
Been thanked: 0 time

Re: duplicate records count

Postby meena » Sat Oct 22, 2011 10:05 pm

plz also tel can we do tis using simple sort if so chk my code whether tis is correct,,,

//step1 exec pgm=sort
//sysout dd sysout=*
//sortin dd dsn=i/p file
//sortout dd dsn=o/p file
//sysin dd *
sort fields=(70,6,zd,a)
include cond=(1,1,ch,eq,c'5')
outfil removecc ,nodetail,
sections=(70,6,
trailer3=(70,6,count=(m10,length=3)))
/*

i just wrote tis with watever i learnt i didnt chk tis but just will this satisfy my requirement..
meena
 
Posts: 11
Joined: Sat Oct 22, 2011 11:59 am
Has thanked: 0 time
Been thanked: 0 time

Re: duplicate records count

Postby BillyBoyo » Sun Oct 23, 2011 1:44 am

You still haven't shown all the report definition.

However, try to check on SUMMARY option, which will suppress the detail line. You can also tell different levels of control-break not to print. If you don't want a final total, on your CONTROL you should look at how to put FINAL NOPRINT.

I don't understand how you can get this order

111010
110909
111212

for your dates after sequencing them.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: duplicate records count

Postby BillyBoyo » Sun Oct 23, 2011 1:46 am

At a glance your Sort code looks OK, but I don't even know which Sort product you use. There are both DFSORT and SYNCSORT forums here, so you could post there as appropriate to stand a better chance of getting an answer.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: duplicate records count

Postby meena » Sun Oct 23, 2011 7:43 am

hi
i got the result in sorted order for the easytrieve... ok let me try with the summary option u told.......
meena
 
Posts: 11
Joined: Sat Oct 22, 2011 11:59 am
Has thanked: 0 time
Been thanked: 0 time

Re: duplicate records count

Postby dick scherrer » Sun Oct 23, 2011 8:44 am

Hello,

what shld i do.......


You should never post the same question in multiple forums. . .

This is locked. The other duplicate has been deleted.

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to CA-Easytrieve

 


  • Related topics
    Replies
    Views
    Last post