IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Skip records depends on count


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lakshmiibmmainframes

New User


Joined: 04 Jan 2017
Posts: 3
Location: india

PostPosted: Sun Dec 24, 2017 9:51 pm
Reply with quote

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

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Sun Dec 24, 2017 10:09 pm
Reply with quote

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

New User


Joined: 04 Jan 2017
Posts: 3
Location: india

PostPosted: Mon Dec 25, 2017 11:10 am
Reply with quote

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

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Mon Dec 25, 2017 8:06 pm
Reply with quote

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

New User


Joined: 04 Jan 2017
Posts: 3
Location: india

PostPosted: Tue Dec 26, 2017 9:00 pm
Reply with quote

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

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Wed Dec 27, 2017 5:05 pm
Reply with quote

Moved to DFSort
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts CA7 count with DATE variable CA Products 0
No new posts To Omit records based n SORT condition DFSORT/ICETOOL 6
No new posts To fetch records that has Ttamp value... DFSORT/ICETOOL 5
No new posts ICETOOL returns no records JCL & VSAM 1
Search our Forums:

Back to Top