View previous topic :: View next topic
|
Author |
Message |
vinay ityala
New User
Joined: 07 Dec 2008 Posts: 5 Location: bangalore
|
|
|
|
Hi All,
I had an I/p file which was displayed in the below format,
Code: |
YEAR MONTH P-TYPE PLASTIC-DESC CUTOFF TYPE 1 Typ2
------ ------ ----- ---------------- ----- -------- -----
2009 04 100 GRCC-GREEN 01 B 0
2009 04 100 GRCC-GREEN 01 B 0
2009 04 100 GRCC-GREEN 01 0 S
2008 04 100 GRCC-GREEN 02 0 S
2007 03 100 RCP-GREEN 01 B 0
2006 04 100 PLAT-GREEN 01 0 S
2005 04 100 GRCC-GREEN 01 B 0 |
------
have up to some 5 lack of records.
I want MY o/p file such that
if Year-month=P-type=plastic-desc=cutoff and depending on type B' or 's' I need to segregate the count of all those records and display in the o/p,
1) In the above I/p file ,Year,month,cut-off will be in ascending order
The o/p file will be have to be some thing like this
Code: |
YEAR MONTH P-TYPE PLASTIC-DESC CUTOFF Total-TYPE 1 Total-Typ2
------ ------ ----- ---------------- ----- -------- -----
2009 04 100 GRCC-GREEN 01 2 0
2009 04 100 GRCC-GREEN 01 0 1
2008 04 100 GRCC-GREEN 02 0 1
2007 03 100 RCP-GREEN 01 1 0
2006 04 100 PLAT-GREEN 01 0 1
2005 04 100 GRCC-GREEN 01 1 0 |
Pls let me know if any sort card(Sync sort is the product we are using in our company)or any other Jcl logic will be suitable for the above requirement,
I had already written a PGM for the above Requiremnt, as the i/p is having huge records, it was taking considerable amount of time and Iam
in the way of searching the altenate methods.
Thanks in advance. |
|
Back to top |
|
|
devangi83
New User
Joined: 05 May 2009 Posts: 7 Location: India
|
|
|
|
how abt useing easytrieve instead of cobol program? |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
devangi83 wrote: |
how abt useing easytrieve instead of cobol program? |
What? The OP is looking for a sort solution.
And where did you read that the OP was using COBOL and not EZT? |
|
Back to top |
|
|
vinay ityala
New User
Joined: 07 Dec 2008 Posts: 5 Location: bangalore
|
|
|
|
Hi devangi83,
easy trieve , i cannot use..
Hi CICS Guy,
JUST FYI..Actually my req . is to read the i/p file which have those may records and have to produce the o/p of matching records and thier count opposite to it..
and what i have done is i have written the cobol program which satisfy the req,Iam cross verifying if any method is there to simlify the process
using sort cards...
let me know if any other info is required.
thanks fot ur quick responses |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Quote: |
let me know if any other info is required. |
Your sample input file appears to already be sorted by YEAR, MONTH, P-TYPE, PLASTIC-DESC & CUTOFF, is this true for your actual input?
If true, a simple copy/sum with trailer processing should provide all you need.
Code: |
YEAR MONTH P-TYPE PLASTIC-DESC CUTOFF Total-TYPE 1 Total-Typ2
------ ------ ----- ---------------- ----- -------- -----
2009 04 100 GRCC-GREEN 01 2 1
2008 04 100 GRCC-GREEN 02 0 1
2007 03 100 RCP-GREEN 01 1 0
2006 04 100 PLAT-GREEN 01 0 1
2005 04 100 GRCC-GREEN 01 1 0 |
Would the above (the 2009 line) be as valid for your purposes?
What is the lrecl and recfm of your input and output?
Does the input have those headers?
Do you want those headers in your output?
By the way, do yourself a favor and "quote" your original post and see how the columns do not line up correctly.
Then highlight the quoted code and copy it and paste it into notepad and convert (if not already) the text to courier new and notice how well the columns do line up.
Neat, right? Just do not use tabs, only spaces. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
vinay ityala,
Adding to the questions raised above,
Do you have any "TYPE 1" values in input file other than 'B' and '0'?
Do you have any "TYPE 2" values in input file other than 'S' and '0'? |
|
Back to top |
|
|
|