IFTHEN for multiple tests



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

IFTHEN for multiple tests

Postby vishnusrini » Wed Jul 07, 2010 3:04 pm

Hi all,

I have a file with record length as 90. In this file i want to change the cols 47 to X, if the cols 11 of 13 character is '336-004-211-0' and if cols 1 of 3 character is 'S03'.

I tried with " IFTHEN " , but i can give only one condition check i.e. either condition check with cols 11 or condition check with cols 1.

OPTION COPY
INCLUDE COND=(1,3,CH,EQ,C'S03',OR,
1,3,CH,EQ,C'###')
OUTREC IFTHEN=(WHEN=(11,13,CH,EQ,C'336-004-211-0'),
OVERLAY=(47:C'V')),
IFTHEN=(WHEN=(11,13,CH,EQ,C'336-004-212-0'),
OVERLAY=(47:C'X'))

This is the coding i am using as SYSIN. In the input file, if the value cols 11 is '336-004-211-0' then 'V' will be moved to cols 47 and if the cols 11 is '336-004-212-0' then 'X' will be moved to cols 47.

Now, i want change these cols 47 if the cols 11 is '336-004-211-0' and cols 1 is 'S03'. I want to do this in JCL only. Please advice me.
vishnusrini
 
Posts: 32
Joined: Wed Jul 07, 2010 2:55 pm
Location: India,bangalore
Has thanked: 0 time
Been thanked: 0 time

Re: JCL

Postby vishnusrini » Wed Jul 07, 2010 3:07 pm

Even i tried by filtering these two value that is present in cols 1 and 11 to a separate file and i change the value in cols 47.

And i tried to merge the file with 'NODUPS' and SUM FIELDS=NONE, both is not working.

Please advice me.
vishnusrini
 
Posts: 32
Joined: Wed Jul 07, 2010 2:55 pm
Location: India,bangalore
Has thanked: 0 time
Been thanked: 0 time

Re: IFTHEN for multiple tests

Postby skolusu » Wed Jul 07, 2010 9:41 pm

vishnusri,

Did you see this ?

dfsort-icetool-icegener/topic3640.html
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: IFTHEN for multiple tests

Postby Frank Yaeger » Wed Jul 07, 2010 9:47 pm

vishnusri,

Your description of what you want is VERY confusing. It would really have helped if you had described clearly what you want to do and had shown an example of your input records and expected output records.

At any rate, you can use multiple conditions in WHEN and you can use multiple IFTHEN clauses as well. Here's an example:

  OUTREC IFTHEN=(WHEN=(11,13,CH,EQ,C'336-004-211-0',AND,   
    1,3,CH,EQ,C'S03'),OVERLAY=(47:C'V'),HIT=NEXT),         
   IFTHEN=(WHEN=(11,13,CH,EQ,C'336-004-212-0',AND,         
    1,3,CH,EQ,C'S03'),OVERLAY=(47:C'X'))                   


Hopefully this will give you an idea of how to do what you want to do (whatever that is).
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: IFTHEN for multiple tests

Postby vishnusrini » Fri Jul 09, 2010 4:36 pm

thanks, it is working....

actually i missed to give "HIT=NEXT" thats why i didn't get the result.
vishnusrini
 
Posts: 32
Joined: Wed Jul 07, 2010 2:55 pm
Location: India,bangalore
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post