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

Applying compound condition


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

New User


Joined: 13 Apr 2010
Posts: 35
Location: Chennai

PostPosted: Fri Apr 11, 2014 6:28 pm
Reply with quote

Hi Guys,

I've got a new requirement in a development process and I'm stuck with below.

1. A VB file is to be filtered based on two conditions.
2. The first condition is supplied as below
Code:
INCLUDE COND=((21,4,CH,EQ,C'ABCD'),AND,
             ((37,6,CH,EQ,C'111111'),OR,
              (37,6,CH,EQ,C'222222'))

3. When a record matches the above COND , I need to strip a value from that record (Pos = 10, Length = 11)
4. I need to frame a second condition, to copy all the records with the striped value in Pos 10.

My question is,
1. Should I apply the condition 1 in a step and write the stripped value to a intermediate file and then use a second step to copy the records from the original input by matching the stripped value to output file?
2. Is there a possibility to do this in a single step. (I prefer this to reduce CPU and EXCP)
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Apr 11, 2014 9:15 pm
Reply with quote

karthickpearl wrote:
Hi Guys,

I've got a new requirement in a development process and I'm stuck with below.

1. A VB file is to be filtered based on two conditions.
4. I need to frame a second condition, to copy all the records with the striped value in Pos 10.

My question is,
1. Should I apply the condition 1 in a step and write the stripped value to a intermediate file and then use a second step to copy the records from the original input by matching the stripped value to output file?
2. Is there a possibility to do this in a single step. (I prefer this to reduce CPU and EXCP)


Karthikpearl,

Before you ask if it can be done , you need to explain what the second condition is?

Assuming it can be done , did you think thru all the possible scenarios?
Lets say your input file has 10 million records and your 1st INCLUDE condition has it filtered to 6 million records. Now if you take the value at position 10 for 2 bytes you have 6 million INCLUDE conditions which I am sure none of the sort products handle. Even if you eliminate duplicate values you still might end up with a number that is impossible to handle via INCLUDE/OMIT

And second question is Do you apply the second condition to original 10 million file or the filtered 6 million file?

Please don't waste your time as other people's time with limited description of what you really want.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Apr 11, 2014 9:26 pm
Reply with quote

Karthikpearl,

We need sample data and expected output. Description. Can you supply a new title, which I will edit in to your original post, please?

For your description, go over it with a team-mate so that you know it makes sense to other people. So far, it does not.
Back to top
View user's profile Send private message
karthickpearl

New User


Joined: 13 Apr 2010
Posts: 35
Location: Chennai

PostPosted: Tue Apr 15, 2014 5:35 pm
Reply with quote

Kolusu,

Quote:
Before you ask if it can be done , you need to explain what the second condition is?


In file-1(Input) i have say 5 Million records.

Cond1:
Get the value of a field (Pos=10, Len=11) based on an include condition(=> as given in my first post)

Cond2:
part1: Copy the record(to the output VB file) that matches the cond1.
part2: There will be few other records after the copied record(varies between 10-30 records max), that will have the same value at (Pos=10,Len=11), which are also to be copied to the output VB file.

My current solution is,
Step1: Read the input file and write the 11 byte matching value to a FB file.
Step2: Read the FB file and and extract all the records from the input file based on the entries in the FB file. (This is done thru COBOL)

The issue in this solution is I need to read the input file(with 5 million recs approx.) twice and hence more EXCP.

Woodger,
Quote:
We need sample data and expected output.

I couldn't post my code due to a regulatory restriction. I have explained as far as I can. If you guys feel some info is missing let me know.

Quote:

Can you supply a new title, which I will edit in to your original post, please?

Since I wanted to do cond2 based on cond1 in a single go, I thought the title was apt. May be suggest me a better title.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Apr 15, 2014 6:08 pm
Reply with quote

Your explanation is still unclear.

Do you mean:

Select some records from a file;
Take a particular value from each record selected;
Select, from the original file, all the records which contain any of the particular values, irrespective of their meeting the first selection criteria?

If not, make it clear, all in one post, with a sample of input and expected output.

If you are unable to post actual data (we wouldn't expect you to be able to, so don't go thinking your site is so special and important) then make some up.

Without sample data (which reflects all relevant conditions) and expected output it is not likely that someone will post a tested solution for you, is it?

At the moment it sounds like a simple JOINKEYS, with the same file as both inputs, and an INCLUDE with a SUM FIELDS=NONE on the JNF2CNTL, but can only guess.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Apr 15, 2014 10:40 pm
Reply with quote

Quote:
Since I wanted to do cond2 based on cond1 in a single go, I thought the title was apt. May be suggest me a better title.


compound condition???
Back to top
View user's profile Send private message
karthickpearl

New User


Joined: 13 Apr 2010
Posts: 35
Location: Chennai

PostPosted: Wed Apr 16, 2014 1:06 pm
Reply with quote

Woodger,
Quote:
Do you mean:

Select some records from a file;
Take a particular value from each record selected;
Select, from the original file, all the records which contain any of the particular values, irrespective of their meeting the first selection criteria?

Yes. Youv'e got my point.
Note:Both cond 1 and cond 2 are applied to the same input file.

dbz,
Quote:
compound condition???

Ok. But I tried to change the title but in vain. Please can you help.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Apr 16, 2014 5:59 pm
Reply with quote

It still sounds like a simple JOINKEYS, with the same file as both inputs, and an INCLUDE with a SUM FIELDS=NONE on the JNF2CNTL. Did you try that?

To set it out a bit more. For each of the two input files for the JOINKEYS, specify the same dataset name.

The JNF1 file will be the file you are extracting your final output from.

The JNF2 file will the file of keys for the extract. Here, you have your INCLUDE (first condition). You just BUILD a fixed-length record for the key values. SUM FIELDS=NONE to make them unique. JOINKEYS will be sorting this by default, so no real extra pain with the SUM.

The the JOINKEYS will be matching on the keys. You don't need to specify a JOIN, as you only want matched records. You can specify a REFORMAT record which just copies the F1 record.

That'll be about it.
Back to top
View user's profile Send private message
karthickpearl

New User


Joined: 13 Apr 2010
Posts: 35
Location: Chennai

PostPosted: Thu Apr 17, 2014 12:43 pm
Reply with quote

Hi Woodger,

I'm working on this. Meanwhile got another high priority task. After the completion of this task, I would continue to work on this compound condition.

Will try with your suggestions and post my results once done.

Thanks for the help.
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 How to give complex condition in JCL . CLIST & REXX 30
No new posts selectively copy based on condition DFSORT/ICETOOL 3
This topic is locked: you cannot edit posts or make replies. Control-m JOB executing even when the... Compuware & Other Tools 6
No new posts Dynamic condition checks COBOL Programming 5
No new posts Extract 2 more lines below line that ... DFSORT/ICETOOL 2
Search our Forums:

Back to Top