COPY DATA FROM FILE 1 TO FILE2 with many modifications



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

Re: COPY DATA FROM FILE 1 TO FILE2 with many modifications

Postby hariharan_bk » Mon Aug 10, 2015 5:40 pm

okay got it.. Thanks
Many Thanks,
Harry
hariharan_bk
 
Posts: 70
Joined: Thu Mar 29, 2012 11:13 am
Has thanked: 5 times
Been thanked: 0 time

Re: Re: COPY DATA FROM FILE 1 TO FILE2 with many modifications

 

Re: COPY DATA FROM FILE 1 TO FILE2 with many modifications

Postby hariharan_bk » Mon Aug 10, 2015 5:48 pm

Hi BillyBoyo,
Could you please take a look at this.

INPUT RECORD1:
...(72 chars)..BAXXXXXXXXXXXXXXXXXX61

INPUT RECORD2:
...(72 chars)..GPXXXXXXXXXXXXXXXXXX60

BA/GP is located at position 73. Then we have 18 char of spaces.
Now at position we have binary values of 60 and 61.

INREC  IFTHEN=(WHEN=(73,2,CH,EQ,C'BA'),                             
                      OVERLAY=(73:C'BABY ACTS WEIRD'),HIT=NEXT),           
      IFTHEN=(WHEN=(73,2,CH,EQ,C'GP'),                               
                      OVERLAY=(73:C'GLOBAL PLAY ENDS'),HIT=NEXT),       
      IFTHEN=(WHEN=(93,2,BI,EQ,61),                                 
                      OVERLAY=(93:C'A'),HIT=NEXT),                   
      IFTHEN=(WHEN=(93,2,BI,NE,61),                                 
                      OVERLAY=(93:C'M'))                             


In the output, i am getting M in the 93 position everytime, though the 93rd position in the input has 61. Could you please help me what I am missing here.
Many Thanks,
Harry
hariharan_bk
 
Posts: 70
Joined: Thu Mar 29, 2012 11:13 am
Has thanked: 5 times
Been thanked: 0 time

Re: COPY DATA FROM FILE 1 TO FILE2 with many modifications

Postby BillyBoyo » Mon Aug 10, 2015 7:13 pm

You are testing two bytes of binary for a value of 61. If instead you want to test for one byte, you need to changed the length to one. Note, you can specify CH as the field-type, and compare to a hexadecimal literal: X'61'.

You don't need the final HIT=NEXT, because if true, you have no more tests to make on that record (EQ and NE are mutually-exclusive).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: COPY DATA FROM FILE 1 TO FILE2 with many modifications

Postby hariharan_bk » Mon Aug 10, 2015 8:10 pm

Okay.. will try and explore that.

missed to inform you this earlier, that those last 2 IF statments are working fine when put in s seperate control card.

//CTL3CNTL DD *                                             
   OPTION COPY                                             
   INREC IFTHEN=(WHEN=(93,2,BI,EQ,61),OVERLAY=(93:C'A')),   
         IFTHEN=(WHEN=(93,2,BI,NE,61),OVERLAY=(93:C'M'))   
/*                                                         
Many Thanks,
Harry
hariharan_bk
 
Posts: 70
Joined: Thu Mar 29, 2012 11:13 am
Has thanked: 5 times
Been thanked: 0 time

Previous

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post