Code: |
519 20 1 3 1 3 519 20 2 2 2 2 519 20 3 3 3 3 519 21 1 3 1 3 519 21 2 2 2 2 519 21 3 3 2 2 |
Code: |
Col1 Col2 Col3 Col4 Col5 Col6 519 20 1 3 1 3 519 20 2 2 2 2 519 20 3 3 3 3 519 21 1 3 1 3 519 21 2 2 2 2 519 21 3 3 2 2 |
Code: |
Output should be : Col1 Col2 Col3 Col4 Col5 Col6 519 20 3 2 3 2 |
Quote: |
(i.e) For Col1 519 and Col2 20 ==> The Unique occuerence of Col3 is '3' , Col4 is '2' , Col5 is '3' , Col6 is '2'. |
Code: |
Col1 Col2 Col3 Col4 Col5 Col6 519 21 3 2 2 2 |
Quote: |
(i.e) For Col1 519 and Col2 21 ==> The Unique occuerence of Col3 is '3' , Col4 is '2' , Col5 is '2' , Col6 is '2'. |
Code: |
Header Col1(519) and Col2(20) combination - Page 1 Col3 Col4 Col5 Col6 3 2 3 2 Header Col1(519) and Col2(21) combination - Page 2 Col3 Col4 Col5 Col6 3 2 2 2 |
Quote: |
But Let me handle the report in a simple cobol program , because it requires some more data to provided in the report. So lets have the output as LRECL = 80 and RECFM = FB. |
mainframemouli wrote: |
1. What is the LRECL and RECFM of the input file?
Though the main input file is variable file with LRECL of 2000 , I could actually derive the input in the format provided in my post above. OK , The LRECL = 80 , RECFM is FB |
Code: |
01 IN-RECORD. 05 COL1 PIC 9(3) COMP-3. 05 XX PIC X. 05 COL2 PIC 9(2). 05 XX PIC X. 05 OHR-COLS. 10 COL3 PIC X(10). 10 COL4 PIC X(10). 10 COL5 PIC X(10). 10 COL6 PIC X(10). etc...... Followed by other fields ....... |
Code: |
SUMMARY REPORT PAGE 1 RUN DATE : XXXX RUN TIME : XXXXX DATA MONTH : COL1 and COL2 COL3 COL4 COL5 COL6 SUMMARY REPORT PAGE 2 RUN DATE : XXXX RUN TIME : XXXXX DATA MONTH : COL1 and COL2 COL3 COL4 COL5 COL6 etc..... |
Code: |
//STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * //SORTOUT DD DSN=&&HD,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE) //SYSIN DD * SORT FIELDS=COPY OUTFIL REMOVECC,FTOV,HEADER1=('$$$') //* //STEP0200 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD DSN=&&HD,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT // DD DSN=your input vb 20503 lrecl file,DISP=SHR // DD DSN=&&HD,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT // DD DSN=your input vb 20503 lrecl file,DISP=SHR // DD DSN=&&HD,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT // DD DSN=your input vb 20503 lrecl file,DISP=SHR // DD DSN=&&HD,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT // DD DSN=your input vb 20503 lrecl file,DISP=SHR //SORTOUT DD SYSOUT=* //SYSIN DD * INREC IFOUTLEN=19, IFTHEN=(WHEN=INIT,BUILD=(1,4,X,5)), IFTHEN=(WHEN=GROUP,BEGIN=(6,3,CH,EQ,C'$$$'),PUSH=(5:ID=1)), IFTHEN=(WHEN=(5,1,ZD,EQ,1),BUILD=(1,4,5,3,9,2,12,10)), IFTHEN=(WHEN=(5,1,ZD,EQ,2),BUILD=(1,4,5,3,9,2,22,10)), IFTHEN=(WHEN=(5,1,ZD,EQ,3),BUILD=(1,4,5,3,9,2,32,10)), IFTHEN=(WHEN=(5,1,ZD,EQ,4),BUILD=(1,4,5,3,9,2,42,10)) SORT FIELDS=(6,2,PD,A,8,2,CH,A,5,1,CH,A,10,10,CH,A) SUM FIELDS=NONE OUTREC IFOUTLEN=13, IFTHEN=(WHEN=(5,1,ZD,EQ,1,AND,6,2,CH,NE,C'$$'), BUILD=(1,4,6,2,PD,EDIT=(TTT),8,2,C'1000')), IFTHEN=(WHEN=(5,1,ZD,EQ,2,AND,6,2,CH,NE,C'$$'), BUILD=(1,4,6,2,PD,EDIT=(TTT),8,2,C'0100')), IFTHEN=(WHEN=(5,1,ZD,EQ,3,AND,6,2,CH,NE,C'$$'), BUILD=(1,4,6,2,PD,EDIT=(TTT),8,2,C'0010')), IFTHEN=(WHEN=(5,1,ZD,EQ,4,AND,6,2,CH,NE,C'$$'), BUILD=(1,4,6,2,PD,EDIT=(TTT),8,2,C'0001')) OUTFIL VTOF,REMOVECC,NODETAIL,BUILD=(80X),OMIT=(6,2,CH,EQ,C'$$'), SECTIONS=(5,5,SKIP=P, HEADER3=(30:'SUMMARY REPORT ',56:'PAGE : ',PAGE,/, 50:'RUN DATE : ',DATE=(4MD-),/, 50:'RUN TIME : ',TIME=(24:),/, 50:'DATA MONTH : ',/), TRAILER3=(5,3,X,8,2,X, TOT=(10,1,ZD,M10,LENGTH=8),X, TOT=(11,1,ZD,M10,LENGTH=8),X, TOT=(12,1,ZD,M10,LENGTH=8),X, TOT=(13,1,ZD,M10,LENGTH=8),/)) //* |
Code: |
HEADER3=(25:'*** SUMMARY REPORT ',56:'PAGE : ',PAGE,/, 50:'RUN DATE : ',DATE=(4MD-),/, 50:'RUN TIME : ',TIME=(24:),/, 50:' ',/, 04:'COL1 COL2 COL3 COL4 COL5 COL6',/, 04:'****** ****** **** **** **** ****'), TRAILER3=(4:5,3,5X,12:8,2,3X, 17:TOT=(10,1,ZD,M10,LENGTH=8),X, 26:TOT=(11,1,ZD,M10,LENGTH=8),X, 35:TOT=(12,1,ZD,M10,LENGTH=8),X, 44:TOT=(13,1,ZD,M10,LENGTH=8),/)) |
mainframemouli wrote: |
Thanks Kolusu , It worked.
Just did couple of modifications : 1. Replaced '//*' to '/*' |
mainframemouli wrote: |
3. Data Month may be a luxury to the requirement , because the same requirement should work for Weekly and monthly. For weekly it should Data week. |
Quote: |
Is that your shop standard? |
Quote: |
You can get the month names(Jan - Dec) easily and the week range(Monday- Sunday dates) easily. |
mainframemouli wrote: |
What is required is
For Monthly : The Datamonth should be MM/YY (Like 01/11) For weekly : The Dataweek should be Week Number for that year. For example for 2011 Jan 1st week should be , WEEK 1 For example for 2011 Jan 2nd week should be , WEEK 2 etc... |
Code: |
//SYMNAMES DD * YNUM,S'&LYR2' MNUM,S'&LMON' |
Code: |
50:'DATA MONTH : ',/), |
Code: |
50:'DATA MONTH : ',MNUM,'/',YNUM,/), |
Code: |
SELECT CHAR('WEEK#,C') ,CHAR('''') ,CHAR(SMALLINT(WEEK(CURRENT DATE))) ,CHAR('''') ,CHAR(' ',65) FROM SYSIBM.SYSDUMMY1; |
Code: |
WEEK#,C'2' |
Code: |
50:'DATA WEEK : ',WEEK#,/), |
output generated using printer-friendly topic mod. All times are GMT - 5 Hours