Page 1 of 1

duplicate records count

PostPosted: Sat Oct 22, 2011 8:16 pm
by meena
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.......

Re: duplicate records count

PostPosted: Sat Oct 22, 2011 9:29 pm
by BillyBoyo
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.

Re: duplicate records count

PostPosted: Sat Oct 22, 2011 9:55 pm
by meena
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

Re: duplicate records count

PostPosted: Sat Oct 22, 2011 10:05 pm
by meena
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..

Re: duplicate records count

PostPosted: Sun Oct 23, 2011 1:44 am
by BillyBoyo
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.

Re: duplicate records count

PostPosted: Sun Oct 23, 2011 1:46 am
by BillyBoyo
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.

Re: duplicate records count

PostPosted: Sun Oct 23, 2011 7:43 am
by meena
hi
i got the result in sorted order for the easytrieve... ok let me try with the summary option u told.......

Re: duplicate records count

PostPosted: Sun Oct 23, 2011 8:44 am
by dick scherrer
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