Double "IF" statement in SORT?



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

Double "IF" statement in SORT?

Postby schneiderusa » Fri Jun 18, 2010 7:28 pm

I have a VB flat file and need to make this small change. I can write a COBOL program but is it possible to do it in SORT?

IF FLD1(1:3) = '111' and FLD2(81:12) = 'XXXXXXXXXXXX'
CHANGE FLD2(81:12) TO 'YYYYYYYYYYYY'

Thanks,
Gary.
schneiderusa
 
Posts: 11
Joined: Tue Mar 23, 2010 11:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Double "IF" statement in SORT?

Postby skolusu » Fri Jun 18, 2010 9:34 pm

schneiderusa ,

Since your input is a VB file, you need to consider the RDW as the actual data starts at position 5. Use the following DFSORT control cards which will give you the desired results

//SYSIN    DD *                                       
  SORT FIELDS=COPY                                     
  INREC IFTHEN=(WHEN=(05,3,CH,EQ,C'111',AND,           
                      85,12,CH,EQ,C'XXXXXXXXXXXX'),   
  OVERLAY=(85:C'YYYYYYYYYYYY'))                       
//*
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: Double "IF" statement in SORT?

Postby schneiderusa » Sat Jun 19, 2010 12:47 am

Thanks a lot.
schneiderusa
 
Posts: 11
Joined: Tue Mar 23, 2010 11:47 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post