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
 

 

Skip records using IFTHEN

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Skip records using IFTHEN
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Tue Nov 15, 2011 2:58 pm    Post subject: Reply to: Skip records using IFTHEN
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Nov 15, 2011 3:04 pm    Post subject: Reply to: Skip records using IFTHEN
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Tue Nov 15, 2011 3:38 pm    Post subject:
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 Moderator


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

PostPosted: Wed Nov 16, 2011 12:41 am    Post subject:
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    Post subject:
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: 28
Location: SHENZHEN CHINA

PostPosted: Wed Nov 16, 2011 7:10 pm    Post subject: Reply to: Skip records using IFTHEN
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Wed Nov 16, 2011 7:16 pm    Post subject: Reply to: Skip records using IFTHEN
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: 28
Location: SHENZHEN CHINA

PostPosted: Wed Nov 16, 2011 7:22 pm    Post subject: Re: Reply to: Skip records using IFTHEN
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Nov 16, 2011 7:25 pm    Post subject: Reply to: Skip records using IFTHEN
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: 28
Location: SHENZHEN CHINA

PostPosted: Wed Nov 16, 2011 7:30 pm    Post subject: Re: Reply to: Skip records using IFTHEN
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Nov 16, 2011 7:34 pm    Post subject: Reply to: Skip records using IFTHEN
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: 28
Location: SHENZHEN CHINA

PostPosted: Wed Nov 16, 2011 7:39 pm    Post subject: Re: Reply to: Skip records using IFTHEN
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: 1714
Location: UK

PostPosted: Wed Nov 16, 2011 9:16 pm    Post subject:
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    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
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts how to split records based on specifi... Venkata Ramayya DFSORT/ICETOOL 6 Wed Sep 28, 2016 3:20 am


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