View previous topic :: View next topic
|
Author |
Message |
lakshmiibmmainframes
New User
Joined: 04 Jan 2017 Posts: 3 Location: india
|
|
|
|
Hi,
I have a requirement as below.
Code: |
MEMBERID STATUSCODE
12345678 51
12345678 51
12345678 51
12345678 51
23345678 31
23345678 51
34567891 71
44444444 51
44444444 51
55555555 11
66666666 51
77777777 51
77777777 51
77777777 51
|
Expected output file:
Code: |
MEMBERID STATUSCODE
12345678 51
12345678 51
12345678 51
12345678 51
23345678 31
34567891 71
55555555 11
77777777 51
77777777 51
77777777 51 |
First 8 bytes represents MEMBERID field and next 2 bytes represents STATUS CODE field.
for each MEMBERID has less than three records with status code 51, those records i need to skip in output file.
Thanks,
Lakshmi. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
And what has this to do with JCL or VSAM? Also, what have you tried. We do not write your code for you - we help you to fix it, preferably by yourself, when it goes wrong. |
|
Back to top |
|
|
lakshmiibmmainframes
New User
Joined: 04 Jan 2017 Posts: 3 Location: india
|
|
|
|
Thanks for your response Nic..
This i want to do with JCL.
Also i have tried as below
1. in first step i tried with OUTFIL to separate records with 51 status in one file and records with other status are in another file.
Code: |
OUTFIL FNAMES=OUT1,INCLUDE=(09,2,CH,EQ,C'51')
OUTFIL FNAMES=OUT2,INCLUDE=(09,2,CH,NE,C'51')
|
2. in second step i have used above first output file(OUT1) as input to this step and i tried to write records each MEMBERID occurs more than 2 times those records write into output file.
i tried with below.
Code: |
OCCUR FROM(INDD) LIST(OUTDD) -
HIGHER(2) -
ON(01,7,CH)
|
but i am not getting expected output.
i am getting output as below.
Let us assume input file in second step.
Code: |
MEMBERID STATUSCODE
12345678 51
12345678 51
12345678 51
12345678 51
22345678 51
22345678 51
77777777 51
77777777 51
77777777 51
88888888 51 |
Expected output:
Code: |
12345678 51
12345678 51
12345678 51
12345678 51
77777777 51
77777777 51
77777777 51
|
Current output i am getting
Code: |
ON(01,7,CH)
12345678
77777777 |
CODE' d |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Well, you cannot do it with JCL. JCL only tells the computer which programs you want to run and the resources require. In this case it looks like you are using a sort product - but which one we do not know because you did not say and you did not post in one of the sort sub-forums.
And when you post data or code or control statements or anything else that you see on the screen use the code tags from the reply editor. This helps us to see more exactly what you have posted as extra spaces are not removed and a fixed font is used thus lining up data correctly.
You can find out about the code tags by looking in the forum for a post by Expat last week.
When you come back with the sort product that you use (and it is NOT sort) then the topic will be moved to the appropriate section of the forum. |
|
Back to top |
|
|
lakshmiibmmainframes
New User
Joined: 04 Jan 2017 Posts: 3 Location: india
|
|
|
|
Hello Nic,
Thanks for your response. I achieved this by using ICETOOL using below command.
SELECT FROM(INDD) TO(OUTDD) ON(1,7,CH) HIGHER(2)
Thanks,
L. Lakshmi. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Moved to DFSort |
|
Back to top |
|
|
|