Page 1 of 1

OUTREC FINDREP=(IN=C'||',OUT=C'|#|') OPTION

PostPosted: Tue Apr 03, 2012 8:57 am
by rekhamf
HI ,

I have the below input file ,which is VB of length 1132 ...

which i like :

|20120215|20131002||||||N|||201|



when i execute the below code :

//SORTOUT  DD DSN=INPUT.FILE1,   
//             DISP=(NEW,CATLG,DELETE),                     
//             UNIT=(PERMDA,9),                             
//             SPACE=(10,(8000,4000),RLSE),                 
//             DCB=(SYS3.DSCB,                             
//             RECFM=VB,LRECL=1132,BLKSIZE=0)               
//SYSIN    DD *                                             
  OPTION COPY                                               
  OUTREC FINDREP=(IN=C'||',OUT=C'|#|')                     




I got the below result

|20120215|20131002|#||#||#|N|#||201|


where all || is not replaced ,,, I need to do until all the || is replaced ...Can you please advice ?

Re: OUTREC FINDREP=(IN=C'||',OUT=C'|#|') OPTION

PostPosted: Tue Apr 03, 2012 11:45 am
by gokulNmf
simple solution is u can run it twice. I am not sure though. U can give a try.

Re: OUTREC FINDREP=(IN=C'||',OUT=C'|#|') OPTION

PostPosted: Tue Apr 03, 2012 12:05 pm
by gokulNmf
By the way this should be posted in "DFSORT/ICETOOL/ICEGENER";
If the job is recurring job then use icetool to first sort it into an intermediate ds and again sorting it out to final ds.

Re: OUTREC FINDREP=(IN=C'||',OUT=C'|#|') OPTION

PostPosted: Tue Apr 03, 2012 12:11 pm
by enrico-sorichetti
why post in the JCL section ?
You should have noticed that there are two sections expressly for <SORT> related questions
find out which <SORT> flavor You are running ...
( ICE... messages indicate DFSORT, WER... messages indicate SYNCSORT )
and post Your questions there
both DFSORT and SYNCSORT sections are followed by TOP experts from the relative companies
so just by asking in the right place You will get answers directly for the best!

Re: OUTREC FINDREP=(IN=C'||',OUT=C'|#|') OPTION

PostPosted: Tue Apr 03, 2012 12:12 pm
by BillyBoyo
From your data I'd say it is happening because the "closing" pipe of the first replacement you expect to be the "opening" pipe of the second. If you check the documentation for your sort product you should find something which describes that.

I think Gokul's suggestion would work, but you'd have to document it if you want to use it permanently, as it will look too much like a code mistake, and someone may take it out without realising the importance.

Why are you putting the hashes in?

Crossing in the post, I see further suggestions from Gokul which I don't understand.

Further post-crossing. If you post in the right place, you'll still get answers from others as well :-)

Re: OUTREC FINDREP=(IN=C'||',OUT=C'|#|') OPTION

PostPosted: Tue Apr 03, 2012 6:29 pm
by rekhamf
Hi ,

Thanks for the response .I'm not aware of this DFSORT section new to forum .I will post there hereafter .

Re: OUTREC FINDREP=(IN=C'||',OUT=C'|#|') OPTION

PostPosted: Tue Apr 03, 2012 10:45 pm
by NicC
You are not that new to the forum and not looking around is just plain bad practice.

Re: OUTREC FINDREP=(IN=C'||',OUT=C'|#|') OPTION

PostPosted: Tue Apr 03, 2012 10:46 pm
by Frank Yaeger
rekhamf,

You can use a DFSORT job like the following to do what you asked for:

//S1 EXEC PGM=SORT                                                 
//SYSOUT DD SYSOUT=*                                               
//SORTIN DD DSN=...  input file (VB)         
//SORTOUT DD DSN=...  output file (VB)
//SYSIN DD *                                                       
  OPTION COPY                                                       
  INREC IFTHEN=(WHEN=INIT,                                         
      FINDREP=(INOUT=(C'||',C'|#|'))),                             
    IFTHEN=(WHEN=INIT,                                             
      FINDREP=(INOUT=(C'||',C'|#|')))     
/*                         

Re: OUTREC FINDREP=(IN=C'||',OUT=C'|#|') OPTION

PostPosted: Fri Apr 06, 2012 7:58 pm
by rekhamf
Thanks Frank.This helps me lot