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

syntax error when using FINDREP option


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

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Fri Feb 26, 2010 8:09 pm
Reply with quote

Hi All,

Input file has LRECL of 600 Fixed Bytes.

There are some numeric fields presents in the input file with two decimals.

For Ex:
36,744.00
Comma and decimal point needs to be removed from these values.So I have used FINDREP option to perform this.
Code:

//SYSIN    DD *                                                       
     OPTION COPY                                                     
     INREC FINDREP=(INOUT=(C',',C'',C'.',C''),STARTPOS=117,ENDPOS=150)
//*                                                                   


It worked fine. Now I want to use the same concept for all the numeric fields which are at different positions. Below code ended with syntax
error.
Code:

//SYSIN    DD *                                                       
   OPTION COPY                                                         
   INREC FINDREP=((INOUT=(C',',C'',C'.',C''),STARTPOS=117,ENDPOS=150),
                 (INOUT=(C',',C'',C'.',C''),STARTPOS=193,ENDPOS=198)) 
//*                                                                   


Can any one help me out from this issue?
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 Feb 26, 2010 9:58 pm
Reply with quote

You have to use IFTHEN clauses for that. Here's the correct DFSORT syntax:

Code:

  OPTION COPY                                                     
  INREC IFTHEN=(WHEN=INIT,                                         
     FINDREP=(INOUT=(C',',C'',C'.',C''),STARTPOS=117,ENDPOS=150), 
       HIT=NEXT),                                                 
    IFTHEN=(WHEN=INIT,                                             
     FINDREP=(INOUT=(C',',C'',C'.',C''),STARTPOS=193,ENDPOS=198)) 
Back to top
View user's profile Send private message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Mon Mar 01, 2010 6:23 pm
Reply with quote

It worked fine. icon_smile.gif

Thanks alot Frank. Its always great to learn new things from you!!!

I have used the same technique in different places where i have been struck with multiple conditions.
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 PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
Search our Forums:

Back to Top