Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Applying compound condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Applying compound condition
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    Post subject: Re: Recursive condition
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7230

PostPosted: Fri Apr 11, 2014 9:26 pm    Post subject: Reply to: Recursive condition
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    Post subject: Reply to: Recursive condition
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7230

PostPosted: Tue Apr 15, 2014 6:08 pm    Post subject: Reply to: Recursive condition
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    Post subject:
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    Post subject: Reply to: Recursive condition
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7230

PostPosted: Wed Apr 16, 2014 5:59 pm    Post subject: Reply to: Applying compound condition
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    Post subject: Reply to: Applying compound condition
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    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
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am
No new posts RFE: Additional compound operators fo... prino PL/I & Assembler 1 Wed Jun 08, 2016 3:31 pm
No new posts 2 vsam file compare and update a fiel... ABINAYATHULASI DFSORT/ICETOOL 6 Sun May 29, 2016 11:15 am
No new posts Applying DB2 V 10.1 PTF. Manshadi DB2 14 Tue Feb 23, 2016 5:19 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us