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

Skip records using IFTHEN


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

New User


Joined: 11 Nov 2011
Posts: 24
Location: India

PostPosted: Tue Nov 15, 2011 2:55 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Tue Nov 15, 2011 2:58 pm
Reply with quote

Why not use INCLUDE/OMIT?
Back to top
View user's profile Send private message
girishbs13

New User


Joined: 11 Nov 2011
Posts: 24
Location: India

PostPosted: Tue Nov 15, 2011 3:02 pm
Reply with quote

Currently, I have coded it using Include. Just wanted to know if its possible by using IFTHEN
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Nov 15, 2011 3:04 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Tue Nov 15, 2011 3:38 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Nov 16, 2011 12:41 am
Reply with quote

girishbs13,

IFTHEN cannot remove records. You need INCLUDE/OMIT for that.
Back to top
View user's profile Send private message
girishbs13

New User


Joined: 11 Nov 2011
Posts: 24
Location: India

PostPosted: Wed Nov 16, 2011 3:52 pm
Reply with quote

thank you Frank Yaeger
Back to top
View user's profile Send private message
giraffe

New User


Joined: 09 Nov 2010
Posts: 27
Location: SHENZHEN CHINA

PostPosted: Wed Nov 16, 2011 7:10 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Wed Nov 16, 2011 7:16 pm
Reply with quote

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
View user's profile Send private message
giraffe

New User


Joined: 09 Nov 2010
Posts: 27
Location: SHENZHEN CHINA

PostPosted: Wed Nov 16, 2011 7:22 pm
Reply with quote

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. icon_mad.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Nov 16, 2011 7:25 pm
Reply with quote

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
View user's profile Send private message
giraffe

New User


Joined: 09 Nov 2010
Posts: 27
Location: SHENZHEN CHINA

PostPosted: Wed Nov 16, 2011 7:30 pm
Reply with quote

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, icon_smile.gif

this statement can not pass syntax check:
INCLUDE=(1,7,ZD,EQ,DATE3)

Is there any syntax error?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Nov 16, 2011 7:34 pm
Reply with quote

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
View user's profile Send private message
giraffe

New User


Joined: 09 Nov 2010
Posts: 27
Location: SHENZHEN CHINA

PostPosted: Wed Nov 16, 2011 7:39 pm
Reply with quote

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! icon_biggrin.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Nov 16, 2011 9:16 pm
Reply with quote

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
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top