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
 
Skip records depends on count

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Skip records depends on count
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: 2092
Location: UK

PostPosted: Sun Dec 24, 2017 10:09 pm    Post subject:
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    Post subject: Skip records depends on count
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: 2092
Location: UK

PostPosted: Mon Dec 25, 2017 8:06 pm    Post subject:
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    Post subject:
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: 2092
Location: UK

PostPosted: Wed Dec 27, 2017 5:05 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Merge two files and sum up the count ... preeti6 JCL & VSAM 6 Thu Sep 06, 2018 10:57 am
No new posts Copy records with unknown LRECL oerdgie DFSORT/ICETOOL 8 Tue Jul 24, 2018 7:50 pm
No new posts Need Help to Create 4 Output Records ... satish.ms10 DFSORT/ICETOOL 5 Thu Jul 19, 2018 1:55 am
No new posts How to Count a particular record in a... Mounika Nemani DFSORT/ICETOOL 5 Tue May 29, 2018 1:07 pm
No new posts MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am

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