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: 7315

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: 10276
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: 7315

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: 7315

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: 10276
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: 10276
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: 1825
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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Need Help with : IFTHEN(WHEN=GROUP) Sumanta_89 DFSORT/ICETOOL 1 Wed Apr 19, 2017 5:23 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


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