View previous topic :: View next topic
|
Author |
Message |
girishbs13
New User
Joined: 11 Nov 2011 Posts: 24 Location: India
|
|
|
|
Hi,
I am using IFTHEN=WHEN(logical exp) to process set of records.
I only want the records matching my criteria to be written to the output.
I want to ignore the records which do not match my selection.
How can this be achieved? How can i skip records in IFTHEN(WHEN=NONE)? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Why not use INCLUDE/OMIT? |
|
Back to top |
|
|
girishbs13
New User
Joined: 11 Nov 2011 Posts: 24 Location: India
|
|
|
|
Currently, I have coded it using Include. Just wanted to know if its possible by using IFTHEN |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
odd question for somebody who in the profile declares ...
Quote: |
Mainframe Skills: DFsort |
and anyway why should we waste time researching for an alternative, if the existing approach works well ? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
girishbs13 wrote: |
Currently, I have coded it using Include. Just wanted to know if its possible by using IFTHEN |
Suggest you consult the DFSORT manuals. At least you'll learn something about IFTHEN, considering your first suggestion. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
girishbs13,
IFTHEN cannot remove records. You need INCLUDE/OMIT for that. |
|
Back to top |
|
|
girishbs13
New User
Joined: 11 Nov 2011 Posts: 24 Location: India
|
|
|
|
thank you Frank Yaeger |
|
Back to top |
|
|
giraffe
New User
Joined: 09 Nov 2010 Posts: 27 Location: SHENZHEN CHINA
|
|
|
|
I encountered a problem like this, i need to just include records that a field is equal to date3, but include cntl stmts can not use date3, meanwhile, i have to judge this cond for only one outfil of my sort task. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you have a new question, you should have started a new topic.
If you search the forum for SYMNAMES you might find some samples which help. |
|
Back to top |
|
|
giraffe
New User
Joined: 09 Nov 2010 Posts: 27 Location: SHENZHEN CHINA
|
|
|
|
Bill Woodger wrote: |
If you have a new question, you should have started a new topic.
If you search the forum for SYMNAMES you might find some samples which help. |
if IFTHEN can omit records, then i can use two IFTHEN statements, firstly, place the date3 into the record, secondly, include records i need based on the field that has value date3..
IFTHEN=(WHEN=INIT,
BUILD=(X,Y,DATE3),HIT=NEXT),
IFTHEN=(WHEN=(X,Y,ZD,EQ,X+Y,7),
...
but i can not. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
i need to just include records that a field is equal to date3, but include cntl stmts can not use date3, |
post clear evidence of it...
a manual quote or a sysout with the error message |
|
Back to top |
|
|
giraffe
New User
Joined: 09 Nov 2010 Posts: 27 Location: SHENZHEN CHINA
|
|
|
|
enrico-sorichetti wrote: |
Quote: |
i need to just include records that a field is equal to date3, but include cntl stmts can not use date3, |
post clear evidence of it...
a manual quote or a sysout with the error message |
OK, tomorrow pls, I'm home now,
this statement can not pass syntax check:
INCLUDE=(1,7,ZD,EQ,DATE3)
Is there any syntax error? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
the error reported is invalid comparison.if You had looked at the DFSORT manual You would have notice that DATA3 is char, not a ZD
Quote: |
The current date can be used as a decimal number (DATE1P, &DATE1P, DATE2P, &DATE2P, DATE3P, &DATE3P) or character string (DATE1, &DATE1, DATE1(c), &DATE1(c), DATE2, &DATE2, DATE2(c), &DATE2(c), DATE3, &DATE3, DATE3(c), &DATE3(c), DATE4, &DATE4). |
an
Code: |
INCLUDE=(1,7,CH,EQ,DATE3) |
worked well for me |
|
Back to top |
|
|
giraffe
New User
Joined: 09 Nov 2010 Posts: 27 Location: SHENZHEN CHINA
|
|
|
|
enrico-sorichetti wrote: |
the error reported is invalid comparison.if You had looked at the DFSORT manual You would have notice that DATA3 is char, not a ZD
Quote: |
The current date can be used as a decimal number (DATE1P, &DATE1P, DATE2P, &DATE2P, DATE3P, &DATE3P) or character string (DATE1, &DATE1, DATE1(c), &DATE1(c), DATE2, &DATE2, DATE2(c), &DATE2(c), DATE3, &DATE3, DATE3(c), &DATE3(c), DATE4, &DATE4). |
an
Code: |
INCLUDE=(1,7,CH,EQ,DATE3) |
worked well for me |
Aha, I get it, thank you so much, enrico! |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
If you had read the whole thread you would have noticed that Frank stated that IFTHEN cannot OMIT/INCLUDE reords - you need to use OMIT/INCLUDE |
|
Back to top |
|
|
|