Page 1 of 1

Doubt on report

PostPosted: Thu Feb 16, 2012 8:26 pm
by shailaja85
Can you please help some one?

Input File

----+----1
AAAAA
AAAAA
BBBBB
BBBBB
BBBBB
BBBBB
BBBBB
CCCCC
DDDDD
DDDDD
DDDDD
EEEEE
EEEEE
EEEEE
EEEEE

Expected Out Put

There are 15 lines (02 AAAAA, 05 BBBBB, 01 CCCCC, 03 DDDDD, 04 EEEEE) on Wednesday 02/15/2012.


Lay out of Input File-1
1-5 bytes Field-A


I need output as total number Field-A and each Field-A how many times it is occurred? And at end of the line it has to give yesterdays date (indicates this report for yesterday)


If it is not possible to generate the report in the above manner, please provide any report format which will gives all the above information (Total number of Field-A and individual Field-A numbers )

Re: Doubt on report

PostPosted: Fri Feb 17, 2012 1:16 pm
by shailaja85
I am OK, if the above requirements have more than 1 step also.

Re: Doubt on report

PostPosted: Fri Feb 17, 2012 1:48 pm
by enrico-sorichetti
try something along the lines of

 000004 //ICE     EXEC PGM=SORT                                                 
 000005 //SYSPRINT  DD SYSOUT=*                                                 
 000006 //SYSOUT    DD SYSOUT=*                                                 
 000007 //DFSMSG    DD SYSOUT=*                                                 
 000008 //SORTIN    DD *                                                       
 000009 AAAAA                                                                   
 000010 BBBBB                                                                   
 000011 BBBBB                                                                   
 000012 BBBBB                                                                   
 000013 CCCCC                                                                   
 000014 CCCCC                                                                   
 000015 CCCCC                                                                   
 000016 CCCCC                                                                   
 000017 //SORTOUT   DD SYSOUT=*,DCB=(RECFM=FB,LRECL=80)                         
 000018 //SYSIN     DD *                                                       
 000019   OPTION EQUALS                                                         
 000020   SORT   FIELDS=(1,5,CH,A)                                             
 000021   OUTFIL REMOVECC,NODETAIL,                                             
 000022          SECTIONS=(1,5,                                                 
 000023                   TRAILER3=(1,5,11:COUNT=(M10,LENGTH=5))),             
 000024          TRAILER1=('ALL  ',11:COUNT=(M10,LENGTH=5))                     


to get ...

********************************* TOP OF DATA **********************************
AAAAA         1                                                                 
BBBBB         3                                                                 
CCCCC         4                                                                 
ALL           8                                                                 
******************************** BOTTOM OF DATA ********************************


to get the info in one line You must set some limit on the number of <keys> to be counted

(*) tested wit DFSORT, from having seen it lurking on the forum SYNCSORT should behave in the same way

Re: Doubt on report

PostPosted: Fri Feb 17, 2012 10:30 pm
by shailaja85
Hi Enrico
Thanks for code and perfectly is working, the format which you have given is good,
IT WOULD BE GREATE if report contains yesterdays date and day. As well.
Like below

AAAAA         1                                                           
BBBBB         3                                                           
CCCCC         4                                                           
ALL           8 

PFB for counters for Wednesday 02/15/2012
or
PFB for counters for 02/15/2012 Wednesday

Re: Doubt on report

PostPosted: Fri Feb 17, 2012 10:35 pm
by Akatsukami
It would even better if you gave all the requirements in the first post :x

Re: Doubt on report

PostPosted: Fri Feb 17, 2012 11:36 pm
by bodatrinadh
I think there is no specific function/logic to generate day's value in Syncsort.
You have to go for Programming language (Either Cobol or SAS or etc...).

Thanks
-3nadh

Re: Doubt on report

PostPosted: Fri Feb 17, 2012 11:59 pm
by enrico-sorichetti
since syncsort is pretty much aligned with dfsort
also syncsort should have the DATEx functions and the WEEKDAY function to do a bit of manipulations on date
it should be enough to check the manual

Re: Doubt on report

PostPosted: Sat Feb 18, 2012 12:09 am
by enrico-sorichetti
since <real writers> write around the problems, I did the same
used

 000019   OPTION EQUALS                                                         
 000020   SORT   FIELDS=(1,5,CH,A)                                             
 000021   INREC  OVERLAY=(81:DATE1(-)-1)                                       
 000022   OUTFIL REMOVECC,NODETAIL,                                             
 000023          SECTIONS=(1,5,                                                 
 000024                   TRAILER3=(1,5,C'*',COUNT=(M10,LENGTH=10),C'*')),     
 000025          TRAILER1=('ALL  ',C'*',COUNT=(M10,LENGTH=10),C'*',/,           
 000026                    'DATE ',C'*',81,10)                                 

to obtain

********************************* TOP OF DATA **********************************
AAAAA*         1*                                                               
BBBBB*         3*                                                               
CCCCC*         4*                                                               
ALL  *         8*                                                               
DATE *2012-02-16                                                               
******************************** BOTTOM OF DATA ********************************


horrid hack, but it works ( for DFSORT at least )

a SYNCSORT expert might come up with a better solution