use SYNCSORT - need to do a type of searh and replace



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

use SYNCSORT - need to do a type of searh and replace

Postby blexann » Tue Dec 02, 2008 3:17 am

I would like to change value in column B based on the values in column B. Is this possible with sybcsort ?

123 456 789
abc def jhi

if column 1-3 has 'abc' then change column 789 to 'xyz'
blexann
 
Posts: 9
Joined: Tue Dec 02, 2008 3:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: use SYNCSORT - need to do a type of searh and replace

 

Re: use SYNCSORT - need to do a type of searh and replace

Postby Alissa Margulies » Tue Dec 02, 2008 3:25 am

Try this:
//SYSIN DD *
   OUTREC IFTHEN=(WHEN=(1,3,CH,EQ,C'abc'),
   OVERLAY=(7:C'xyz'))
/*
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: use SYNCSORT - need to do a type of searh and replace

Postby blexann » Tue Dec 02, 2008 8:20 am

I dont believe ifthen is supported by syncsort. is there a way to do this using the change command ?
blexann
 
Posts: 9
Joined: Tue Dec 02, 2008 3:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: use SYNCSORT - need to do a type of searh and replace

Postby dick scherrer » Tue Dec 02, 2008 8:24 am

Hello,

Please notice that Alissa is a tech rep from Syncsort. . . .

I dont believe ifthen is supported by syncsort.
If my memory is working, ifthen has been in Syncsort for some time (since release 1.2.x) - which is no longer even the current product release. Release 1.3 became available many months ago.

Did you try the suggested code? What happened? If you've not tried this, do so and post any diagnostic info presented including the message ids.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: use SYNCSORT - need to do a type of searh and replace

Postby blexann » Tue Dec 02, 2008 7:56 pm

..oh sorry about that. below is my current sort - I was trying to incorporate the suggested solution to the below sort. I need to chagne UNIT to '09702' only if ACCOUNT is one of '0036' OR '0041' OR '0042'


INCLUDE COND=((10,5,BI,EQ,X'000001000F'),OR,                           
                         (10,5,BI,EQ,X'000001001F'),OR,                           
                        (10,5,BI,EQ,X'000001003F'),OR,                           
                        (10,5,BI,EQ,X'000001021F'))                             
INREC FIELDS=(1,1270,1271,3,                     * IF = 95189         
              CHANGE=(3,X'95189F',X'97740F'),    * MAKE IT 97740         
              NOMATCH=(1271,3))                      * ELSE LEAVE IT         
SORT FIELDS=(1,5,PD,A,10,5,PD,A)                     
OUTREC FIELDS=(C'1',                             
               2,4,PD,M11,LENGTH=7,                           
               34C' ',                             
               C'000',                       
               10,5,PD,M11,LENGTH=9,               
               C'A0810',                         
               C'     ',                               
               1271,3,PD,M11,LENGTH=5,   
               1262,3,PD,M11,LENGTH=4,       [u][b]ACCOUNT[/b][/u]                 
               1271,3,PD,M11,LENGTH=5,       [u][b]UNIT[/b][/u]                 
               1265,4,PD,M11,LENGTH=7,                 
               C'0',                         
               C'1   ',                     
               1269,2,PD,M11,LENGTH=3)

"Code"ed for readability
blexann
 
Posts: 9
Joined: Tue Dec 02, 2008 3:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: use SYNCSORT - need to do a type of searh and replace

Postby Alissa Margulies » Tue Dec 02, 2008 9:12 pm

blexann,

Which release of SyncSort are you running? Did you try to code the IFTHEN statement? If you tried, but you got an error, what was the error message?
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: use SYNCSORT - need to do a type of searh and replace

Postby blexann » Tue Dec 02, 2008 11:47 pm

SYNCSORT FOR Z/OS 1.3.0.1R

I tried the below and it seems to do what I want. Please let me know if I am doing it correctly.

INCLUDE COND=((10,5,BI,EQ,X'000001000F'),OR,
(10,5,BI,EQ,X'000001001F'),OR,
(10,5,BI,EQ,X'000001003F'),OR,
(10,5,BI,EQ,X'000001021F'))
INREC IFTHEN=(WHEN=(1262,3,BI,EQ,X'00036F'),OVERLAY=(1271:X'85726F')),
IFTHEN=(WHEN=(1262,3,BI,EQ,X'00041F'),OVERLAY=(1271:X'85726F')),
IFTHEN=(WHEN=(1262,3,BI,EQ,X'00042F'),OVERLAY=(1271:X'85726F')),
IFTHEN=(WHEN=(1262,3,BI,EQ,X'00046F'),OVERLAY=(1271:X'85726F')),
IFTHEN=(WHEN=(1262,3,BI,EQ,X'00047F'),OVERLAY=(1271:X'85726F')),
IFTHEN=(WHEN=(1262,3,BI,EQ,X'00049F'),OVERLAY=(1271:X'85726F')),
IFTHEN=(WHEN=(1262,3,BI,EQ,X'00052F'),OVERLAY=(1271:X'85726F')),
IFTHEN=(WHEN=(1262,3,BI,EQ,X'04399F'),OVERLAY=(1271:X'85726F'))
SORT FIELDS=(1,5,PD,A,10,5,PD,A)
OUTREC FIELDS=(C'1',
2,4,PD,M11,LENGTH=7,
34C' ',
C'000',
10,5,PD,M11,LENGTH=9,
C'A0810',
C' ',
1271,3,PD,M11,LENGTH=5,
1262,3,PD,M11,LENGTH=4, * ACCOUNT
1271,3,PD,M11,LENGTH=5, * UNIT
1265,4,PD,M11,LENGTH=7,
C'0',
C'1 ',
1269,2,PD,M11,LENGTH=3)
blexann
 
Posts: 9
Joined: Tue Dec 02, 2008 3:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: use SYNCSORT - need to do a type of searh and replace

Postby Alissa Margulies » Wed Dec 03, 2008 12:13 am

blexann,

You can simplify the INCLUDE statement as follows:

INCLUDE COND=((10,5,BI,EQ,L(X'000001000F',X'000001001F',
        X'000001003F',X'000001021F'))

You can also simplify the INREC statement as follows:

INREC IFTHEN=(WHEN=(1262,3,BI,EQ,L(X'00036F',X'00041F',X'00042F',
      X'00046F',X'00047F',X'00049F',X'00052F',X'04399F')),
      OVERLAY=(1271:X'85726F'))
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: use SYNCSORT - need to do a type of searh and replace

Postby blexann » Wed Dec 03, 2008 3:50 am

...waht does the L mean at the end of this statement ? INREC IFTHEN=(WHEN=(1262,3,BI,EQ,L


..thanks for your help
blexann
 
Posts: 9
Joined: Tue Dec 02, 2008 3:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: use SYNCSORT - need to do a type of searh and replace

Postby dick scherrer » Wed Dec 03, 2008 3:55 am

Hello,

The L indicates a List of Literal values follow.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post