Page 2 of 2

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

PostPosted: Mon Aug 10, 2015 5:40 pm
by hariharan_bk
okay got it.. Thanks

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

PostPosted: Mon Aug 10, 2015 5:48 pm
by hariharan_bk
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.

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

PostPosted: Mon Aug 10, 2015 7:13 pm
by BillyBoyo
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).

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

PostPosted: Mon Aug 10, 2015 8:10 pm
by hariharan_bk
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'))   
/*