|
View previous topic :: View next topic
|
| Author |
Message |
HameedAli
Active User
Joined: 16 Apr 2009 Posts: 151 Location: India
|
|
|
|
Hi,
How do I achieve this?
Input
| Code: |
PARAMETER CARD: 0120120902NN
*----------------------------------------*
ROW PROCESSED FROM TABLE01 TABLE : 5598
ROW WRITTEN INTO FILE0001 FILE : 4673
RELATION NOT FOUND ON TBALE004 : 924
RELATION NOT FOUND ON TABLE02 : 35
RELATION NOT FOUND ON TABLE03 : 1973
ROW DISCARDED ON TBALE004 / TABLE02 : 0
*----------------------------------------*
******************************
---> COMMIT
******************************
END PROGRAM1
******************************
PARAMETER CARD: 0120120902NN
*----------------------------------------*
ROW PROCESSED FROM TABLE01 TABLE : 5597
ROW WRITTEN INTO FILE0001 FILE : 4672
RELATION NOT FOUND ON TBALE004 : 923
RELATION NOT FOUND ON TABLE02 : 34
RELATION NOT FOUND ON TABLE03 : 1972
ROW DISCARDED ON TBALE004 / TABLE02 : 0
*----------------------------------------*
******************************
---> COMMIT
******************************
END PROGRAM1
******************************
PARAMETER CARD: 0120120902NN
*----------------------------------------*
ROW PROCESSED FROM TABLE01 TABLE : 5596
ROW WRITTEN INTO FILE0001 FILE : 4671
RELATION NOT FOUND ON TBALE004 : 922
RELATION NOT FOUND ON TABLE02 : 33
RELATION NOT FOUND ON TABLE03 : 1971
ROW DISCARDED ON TBALE004 / TABLE02 : 0
*----------------------------------------*
******************************
---> COMMIT
******************************
END PROGRAM1
****************************** |
Output
| Code: |
PARAMETER CARD: 0120120902NN
*----------------------------------------*
ROW PROCESSED FROM TABLE01 TABLE : 16791
ROW WRITTEN INTO FILE0001 FILE : 14013
RELATION NOT FOUND ON TBALE004 : 2763
RELATION NOT FOUND ON TABLE02 : 96
RELATION NOT FOUND ON TABLE03 : 5910
ROW DISCARDED ON TBALE004 / TABLE02 : 0
*----------------------------------------* |
This SYSIN helps in achieving the results like this.
| Code: |
//SYSIN DD *
OMIT COND=(1,11,CH,EQ,C'---> COMMIT',OR,
1,30,CH,EQ,C'******************************',OR,
8,18,CH,EQ,C'END PROGRAM1')
INREC IFTHEN=(WHEN=INIT,OVERLAY=(41:41,9,SFF,PD,LENGTH=9,
81:SEQNUM,4,ZD))
SORT FIELDS=(1,40,CH,A)
SUM FIELDS=(41,9,PD)
OUTREC FIELDS=(1:1,40,
41:41,9,PD,EDIT=(IIIIIIIIT),
50:31X,
81:81,4)
/* |
Output of above SYSIN
| Code: |
0
0
*--------------------------------------- 0
PARAMETER CARD: 0120120902NN 0
RELATION NOT FOUND ON TABLE03 : 5910
RELATION NOT FOUND ON TABLE02 : 96
RELATION NOT FOUND ON TBALE004 : 2763
ROW DISCARDED ON TBALE004 / TABLE02 : 0
ROW PROCESSED FROM TABLE01 TABLE : 16791
ROW WRITTEN INTO FILE0001 FILE : 14013 |
|
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If you cannot be considerate enough to post in the correct part of the forum, we should delete these posts. . .
For whatever reason you post in both parts of the forum . . .
d |
|
| Back to top |
|
 |
HameedAli
Active User
Joined: 16 Apr 2009 Posts: 151 Location: India
|
|
|
|
| Excuse for that. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I'd get rid of everything with blank, asterisk or hyphen in column 1.
Define a GROUP with "PARAMETER CARD" indicating the start, and PUSH a SEQNO to all records in the group.
Sort on that Seqno first, then on the description.
In your OUTFIL, don't print the count for "PARAMETER CARD", but do use the '/' (slash operator) in IFTHEN=(WHEN with BUILD to output such blank lines that you want and your first delimiting line, after your "PARAMETER CARD".
Use "ROW DISCARDED" in IFTHEN=(WHEN with BUILD and '/' to output your 2nd delimiting line. |
|
| Back to top |
|
 |
HameedAli
Active User
Joined: 16 Apr 2009 Posts: 151 Location: India
|
|
|
|
| Thanks for the suggestion. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Since you are producing a report, you could also consider the "reporting functions" on OUTFIL. In addition to the seqno, PUSH the "PARAMETER CARD". Remove the SUM.
On OUTFIL, OMIT the "PARAMETER CARD" (not needed) and use HEADER1 to print the "headings" of the "PARAMETER CARD", blank lines and delimiter line, use SECTIONS to do the totals and TRAILER1 to do your closing delimiter line. |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
HameedAli,
You can simplify your extract logic using INCLUDE condition instead of OMIT condition. Looking at your data , all you want is to include records that begin with P or an R. Assuming that you just have Unique Parameter card , the following DFSORT JCL will give you the desired results.
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=Your Input Fb 80 Byte file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INCLUDE COND=(1,1,SS,EQ,C'P,R')
INREC OVERLAY=(81:41,9,UFF,PD,LENGTH=5)
SORT FIELDS=(1,40,CH,A)
SUM FIELDS=(81,5,PD)
OUTFIL IFOUTLEN=80,REMOVECC,TRAILER1=('*',43'-','*'),
IFTHEN(WHEN=INIT,BUILD=(1,40,81,5,PD,M10,LENGTH=9,81:SEQNUM,8,ZD)),
IFTHEN(WHEN=(1,15,CH,EQ,C'PARAMETER CARD:'),
BUILD=(1,40,/,/,C'*',43C'-',C'*'))
//* |
The output from the above Sample data is
| Code: |
PARAMETER CARD: 0120120902NN
*-------------------------------------------*
RELATION NOT FOUND ON TABLE02 : 102
RELATION NOT FOUND ON TABLE03 : 5916
RELATION NOT FOUND ON TBALE004 : 2769
ROW DISCARDED ON TBALE004 / TABLE02 : 0
ROW PROCESSED FROM TABLE01 TABLE : 16791
ROW WRITTEN INTO FILE0001 FILE : 14016
*-------------------------------------------* |
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|