IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

FINDREP on specific location


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manoz_k

New User


Joined: 08 Mar 2007
Posts: 23
Location: CHENNAI

PostPosted: Fri Aug 21, 2009 3:52 am
Reply with quote

I have following Control Card which replaces based on the condition

Code:

  OPTION COPY                           
  INREC IFTHEN=(WHEN=(23,1,CH,NE,C'1'),
     FINDREP=(IN=X'00',OUT=X'40'))         


But what change i need to do if i want to change specific bytes only..

Suppose if 23 Byte is not C'1' i want to change all NULLS from Pos-30 to Pos-40 to Blanks.

How can i specify location while using FINDREP ?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Aug 21, 2009 5:33 am
Reply with quote

Hi,


see link ibmmainframes.com/viewtopic.php?t=43055&highlight=startpos+endpos


Gerry
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Aug 21, 2009 9:10 pm
Reply with quote

Manoj,

You can use these DFSORT control statements:

Code:

  OPTION COPY                                             
  INREC IFTHEN=(WHEN=(23,1,CH,NE,C'1'),                   
    FINDREP=(IN=X'00',OUT=X'40',STARTPOS=30,ENDPOS=40))   


For complete details on DFSORT's FINDREP function, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000085
Back to top
View user's profile Send private message
manoz_k

New User


Joined: 08 Mar 2007
Posts: 23
Location: CHENNAI

PostPosted: Fri Aug 21, 2009 11:40 pm
Reply with quote

Frank Yaeger wrote:
Manoj,

You can use these DFSORT control statements:

Code:

  OPTION COPY                                             
  INREC IFTHEN=(WHEN=(23,1,CH,NE,C'1'),                   
    FINDREP=(IN=X'00',OUT=X'40',STARTPOS=30,ENDPOS=40))   


For complete details on DFSORT's FINDREP function, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000085


Frank,

I have two conditions here
1) WHEN=(23,1,CH,NE,C'1')
2) WHEN=(23,1,CH,EQ,C'1')

and based on that i have two different actions respectively

FINDREP=(IN=X'00',OUT=X'40',STARTPOS=30,ENDPOS=40))
FINDREP=(IN=X'00',OUT=X'40',STARTPOS=819,ENDPOS=860))

I want something like
Code:

OPTION COPY                                             
  INREC IFTHEN=(WHEN=(23,1,CH,EQ,C'1'),                 
  FINDREP=(IN=X'00',OUT=X'40',STARTPOS=37,ENDPOS=900))   
  INREC IFTHEN=(WHEN=(23,1,CH,NE,C'1'),                 
  FINDREP=(IN=X'00',OUT=X'40',STARTPOS=819,ENDPOS=834)) 



But i could not mimic two FINDREPs together with two WHEN conditions.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Aug 22, 2009 1:16 am
Reply with quote

You need to use one INREC with two IFTHEN clauses, not two INRECs. You need to use HIT=NEXT for the first IFTHEN clause. Here are the DFSORT statements:

Code:

  OPTION COPY                                                       
  INREC IFTHEN=(WHEN=(23,1,CH,EQ,C'1'),                             
     FINDREP=(IN=X'00',OUT=X'40',STARTPOS=37,ENDPOS=900),           
     HIT=NEXT),                                                     
  IFTHEN=(WHEN=(23,1,CH,NE,C'1'),                                   
    FINDREP=(IN=X'00',OUT=X'40',STARTPOS=819,ENDPOS=834))           


Note that you could use WHEN=NONE for the second IFTHEN clause.
Back to top
View user's profile Send private message
manoz_k

New User


Joined: 08 Mar 2007
Posts: 23
Location: CHENNAI

PostPosted: Sat Aug 22, 2009 3:36 am
Reply with quote

Thank you very much Frank. It worked well.I corrected my mistake of using INREC twice.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
This topic is locked: you cannot edit posts or make replies. Construct new record using specific f... DFSORT/ICETOOL 6
No new posts Select a DB2 value in a specific deci... DB2 4
No new posts Need to find a specific STRING COBOL Programming 11
Search our Forums:

Back to Top