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

JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

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

Postby rekhamf » Tue Apr 03, 2012 8:57 am

HI ,

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

which i like :

Code: Select all
|20120215|20131002||||||N|||201|



when i execute the below code :

Code: Select all
//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

Code: Select all
|20120215|20131002|#||#||#|N|#||201|


where all || is not replaced ,,, I need to do until all the || is replaced ...Can you please advice ?
rekhamf
 
Posts: 33
Joined: Mon Nov 28, 2011 5:09 am

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

Postby gokulNmf » Tue Apr 03, 2012 11:45 am

simple solution is u can run it twice. I am not sure though. U can give a try.
Cheers,
Gokul
User avatar
gokulNmf
 
Posts: 114
Joined: Sat Mar 28, 2009 6:41 pm
Location: India

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

Postby gokulNmf » Tue Apr 03, 2012 12:05 pm

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.
Cheers,
Gokul
User avatar
gokulNmf
 
Posts: 114
Joined: Sat Mar 28, 2009 6:41 pm
Location: India

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

Postby enrico-sorichetti » Tue Apr 03, 2012 12:11 pm

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!
regards
Enrico
enrico-sorichetti
 
Posts: 2163
Joined: Fri Apr 18, 2008 11:25 pm

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

Postby BillyBoyo » Tue Apr 03, 2012 12:12 pm

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 :-)
BillyBoyo
Global moderator
 
Posts: 3205
Joined: Tue Jan 25, 2011 12:02 am

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

Postby rekhamf » Tue Apr 03, 2012 6:29 pm

Hi ,

Thanks for the response .I'm not aware of this DFSORT section new to forum .I will post there hereafter .
rekhamf
 
Posts: 33
Joined: Mon Nov 28, 2011 5:09 am

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

Postby NicC » Tue Apr 03, 2012 10:45 pm

You are not that new to the forum and not looking around is just plain bad practice.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2202
Joined: Sun Jul 04, 2010 12:13 am
Location: Down on the pig farm

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

Postby Frank Yaeger » Tue Apr 03, 2012 10:46 pm

rekhamf,

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

Code: Select all
//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'|#|')))     
/*                         
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1082
Joined: Sat Jun 09, 2007 8:44 pm

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

Postby rekhamf » Fri Apr 06, 2012 7:58 pm

Thanks Frank.This helps me lot
rekhamf
 
Posts: 33
Joined: Mon Nov 28, 2011 5:09 am


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post