Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
counting the adjacent fields and writing in o/p file.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
vinay ityala

New User


Joined: 07 Dec 2008
Posts: 5
Location: bangalore

PostPosted: Sun May 10, 2009 3:23 pm    Post subject: counting the adjacent fields and writing in o/p file.
Reply with quote

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
View user's profile Send private message

devangi83

New User


Joined: 05 May 2009
Posts: 7
Location: India

PostPosted: Sun May 10, 2009 8:36 pm    Post subject:
Reply with quote

how abt useing easytrieve instead of cobol program?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sun May 10, 2009 8:55 pm    Post subject:
Reply with quote

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
View user's profile Send private message
vinay ityala

New User


Joined: 07 Dec 2008
Posts: 5
Location: bangalore

PostPosted: Sun May 10, 2009 10:38 pm    Post subject:
Reply with quote

Hi devangi83,

easy trieve , i cannot use.. icon_sad.gif

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sun May 10, 2009 11:24 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2287
Location: @my desk

PostPosted: Mon May 11, 2009 2:58 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us