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

Help needed in FINDREP


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

New User


Joined: 13 Feb 2008
Posts: 16
Location: Chennai

PostPosted: Thu Aug 13, 2009 4:38 pm
Reply with quote

Hi,
I have a input file which has three fields which should be numeric. so if the file has spaces in these fields i need to replace them with zeroes.
the following sort steps works fine for me.
but i have to use FINDREP seperately for each column. Is it possible to use one control card to FINDREP all the three fields?

COPY FROM(WORK16) TO(SORT01) USING(TMP1)
COPY FROM(SORT01) TO(SORT02) USING(TMP2)
COPY FROM(SORT02) TO(SORT01) USING(TMP3)

//TMP1CNTL DD *
OUTREC FINDREP=(IN=C' ',OUT=C'000000000000000.00',
STARTPOS=27,ENDPOS=44)
/*
//TMP2CNTL DD *
OUTREC FINDREP=(IN=C' ',OUT=C'000000000000000.00',
STARTPOS=47,ENDPOS=64)
/*
//TMP3CNTL DD *
OUTREC FINDREP=(IN=C' ',OUT=C'000000000000000.00',
STARTPOS=67,ENDPOS=84)
/*
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Aug 13, 2009 6:19 pm
Reply with quote

Hi Anu,
I think you are going way complicated..
Please show us some sample input file records to get better solution.
(Use code Tag while posting sample records)
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Aug 13, 2009 7:01 pm
Reply with quote

I think you can use EDIT MASK PATTERNS instead of using FINDREP for it.
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: Thu Aug 13, 2009 8:52 pm
Reply with quote

Anu,

Your FINDREP statements don't make sense. I suspect you're just trying to replace a field that has a blank in 27, 47 or 67 with C'000000000000000.00' starting in that position, but FINDREP is NOT the right way to do that.

If that is what you're trying to do, then you can use a DFSORT job like the following:

Code:

//S1   EXEC  PGM=SORT                                             
//SYSOUT   DD  SYSOUT=*                                           
//SORTIN DD DSN=...  input file                             
//SORTOUT DD DSN=...  output file   
//SYSIN DD *                                                     
  OPTION COPY                                                     
  INREC IFTHEN=(WHEN=(27,1,CH,EQ,C' '),                           
     OVERLAY=(27:C'000000000000000.00'),HIT=NEXT),               
  IFTHEN=(WHEN=(47,1,CH,EQ,C' '),                                 
     OVERLAY=(47:C'000000000000000.00'),HIT=NEXT),               
  IFTHEN=(WHEN=(67,1,CH,EQ,C' '),                                 
     OVERLAY=(67:C'000000000000000.00'))                         


If that's not what you're trying to do, then you need to explain what you are trying to do. Show an example of the records in each input file and what you expect for output. Explain the "rules" for getting fron input to output. Give the RECFM and LRECL of the input file.
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 FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
No new posts Help needed to assemble IMS sample co... ABENDS & Debugging 4
No new posts RABBIT HOLE NEEDED - "Live"... All Other Mainframe Topics 0
No new posts Mainframe profiles needed @ Cognizant Mainframe Jobs 0
Search our Forums:

Back to Top