Page 1 of 1

Check if the data in file is greater than 'x' using DFSORT

PostPosted: Mon Jun 01, 2015 9:01 pm
by shivanshu26shiv
I need to check if the data in i/p file is greater than 200 using DFSORT,

I/p file:
________________
any-positive-integer
________________

LRECL = 18, BLKSIZE = 18, TYPE = FB

I am using,

OUTREC IFTHEN=(WHEN=(1,18,ZD,GT,+200),BUILD=(1,18))

I have also tried,

INCLUDE=(1,18,ZD,GT,+200)

but its not working...

O/p contains only I/p data...pls help to rectify
or let me know if any other info required,

Re: Check if the data in file is greater than 'x' using DFSO

PostPosted: Mon Jun 01, 2015 9:47 pm
by Terry Heinze
In the future, please post your question in the appropriate area.

Re: Check if the data in file is greater than 'x' using DFSO

PostPosted: Mon Jun 01, 2015 9:49 pm
by shivanshu26shiv
I apologize.., but pls elaborate yourself...

Re: Check if the data in file is greater than 'x' using DFSO

PostPosted: Mon Jun 01, 2015 9:52 pm
by BillyBoyo
The topic has been moved to the correct part of the forum.

Can you show a sample of your data, please?

Re: Check if the data in file is greater than 'x' using DFSO

PostPosted: Mon Jun 01, 2015 9:57 pm
by shivanshu26shiv
Thanks for moving but pls do tell me the place to avoid any future dicrepancies,

As I have said, data consists of 1 line positive integer for eg;
------------------
123-> here I need to check that 123 < 200,
------------------
or
------------------
321-> here I need to check that 321 > 200,
------------------

Re: Check if the data in file is greater than 'x' using DFSO

PostPosted: Mon Jun 01, 2015 10:15 pm
by BillyBoyo
For DFSORT questions, there is a DFSORT section underneath the IBM Utilities and Tools

OK, you said, but we didn't know exactly what you'd got wrong. Now we do. Your data is not ZD, so what you coded on the INCLUDE won't work.

Use UFF instead of ZD as the type in your INCLUDE.

Re: Check if the data in file is greater than 'x' using DFSO

PostPosted: Mon Jun 01, 2015 10:47 pm
by shivanshu26shiv
Thanks BillyBoyo,

INCLUDE=(1,18,UFF,GT,+200) worked,
but
IFTHEN=(WHEN=(1,18,UFF,GT,+200),BUILD=(1,18)) didn't..

Anyways thanks.

Re: Check if the data in file is greater than 'x' using DFSO

PostPosted: Mon Jun 01, 2015 11:11 pm
by BillyBoyo
You say the IFTHEN didn't work, but how would you know? All it is doing is creating a new current record, identical to the old.

If you change the BUILD to =(1,18,C'!') I think you'll find it "working", just not doing what you hoped it would do. The only way records can be selected is with INCLUDE COND=, OMIT COND= and INCLUDE=/OMIT= on OUTFIL. IFTHEN is nothing to do with record selection.

Re: Check if the data in file is greater than 'x' using DFSO

PostPosted: Mon Jul 06, 2015 7:42 pm
by shivanshu26shiv
It worked, thanks a lot :)