Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Help needed in FINDREP

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Help needed in FINDREP
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Aug 13, 2009 8:52 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts Syncsort version supporting FINDREP c... juares castro SYNCSORT 9 Tue Aug 09, 2016 6:54 pm
No new posts Help Needed with View Direct shailesh_do CA Products 2 Wed Jul 13, 2016 10:39 am
No new posts Information needed on using the COBAN... venugopal.dondla COBOL Programming 5 Thu Oct 08, 2015 3:34 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us