Page 1 of 1

Specify a record and next of this record.

PostPosted: Wed Oct 03, 2012 11:14 am
by Mehdi shri
Dear friend
I have an input like this:

ACCO 0100003580
ACCO 0100003581
MONT 9926
ACCO 0100003582
MONT 9926
ACCO 0100003583
ACCO 0100003584
ACCO 0100003586
MONT 9926
ACCO 0100003587
MONT 9926

I want to extracat records which has contain "MONT 9926" right after these whit itself. Output I want is:

ACCO 0100003581
MONT 9926
ACCO 0100003582
MONT 9926
ACCO 0100003586
MONT 9926
ACCO 0100003587
MONT 9926

Re: Specify a record and next of this record.

PostPosted: Wed Oct 03, 2012 9:15 pm
by skolusu
Mehdi shri,

Use the following the DFSORT/ICETOOL JCL which will give you the desired results
//STEP0100 EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG   DD SYSOUT=*                                   
//IN       DD *                                           
ACCO 0100003580                                           
ACCO 0100003581                                           
MONT 9926                                                 
ACCO 0100003582                                           
MONT 9926                                                 
ACCO 0100003583                                           
ACCO 0100003584                                           
ACCO 0100003586                                           
MONT 9926                                                 
ACCO 0100003587                                           
MONT 9926                                                 
//OUT      DD SYSOUT=*                                   
//TOOLIN   DD *                                           
  SELECT FROM(IN) TO(OUT) ON(81,8,CH) ALLDUPS USING(CTL1)
//CTL1CNTL DD *                                           
  OPTION COPY                                             
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),     
  IFTHEN=(WHEN=(1,9,CH,EQ,C'MONT 9926'),                 
  OVERLAY=(81:81,8,ZD,SUB,+1,M11,LENGTH=8))               
                                                         
  OUTFIL BUILD=(1,80)                                     
//*

Re: Specify a record and next of this record.

PostPosted: Sun Oct 07, 2012 1:59 pm
by Mehdi shri
Dear skolusu
I used this your offer but I give MAXCC=16 and :
ICE056A 9 CTL1OUT NOT DEFINED

Wahts the CTL1OUT ? And how is must be define?

Re: Specify a record and next of this record.

PostPosted: Sun Oct 07, 2012 3:06 pm
by NicC
Did you cut and paste Kolusu's solution? What do you have for the TO parameter on the TOOLIN card? If you hve CTL1OUT then that is the area in which your problem lies but without you posting what JCL and control cards you used for the step (in code tags) then we do not really know where you went wrong. Kolusu runs his solutions before posting so if there is an error it is on your part.

Re: Specify a record and next of this record.

PostPosted: Mon Oct 08, 2012 8:30 am
by dick scherrer
Hello,

If you Did Not copy/paste, but rather re-typed, start over.

If you copy/paste and still have a problem, you need to post the jcl and sort control statements you submitted and the informational and diagnostic into presented by the run.

Do NOT try to post only what you believe we need to help.

Re: Specify a record and next of this record.

PostPosted: Mon Oct 08, 2012 12:35 pm
by Mehdi shri
This is my JCL:

//MESORT03 JOB 4320,A-0055,CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP0100 EXEC PGM=ICETOOL                                 
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//IN       DD *                                             
  ACCO 0100003580                                           
  ACCO 0100003581                                           
  MONT 9926                                                 
  ACCO 0100003582                                           
  MONT 9926                                                 
  ACCO 0100003583                                           
  ACCO 0100003584                                           
  ACCO 0100003586                                           
  MONT 9926                                                 
  ACCO 0100003587                                           
  MONT 9926                                                 
//OUT      DD SYSOUT=*   
//TOOLIN   DD *       
  SELECT FROM(IN) TO(OUT) ON(81,8,CH) ALLDUPS USING(CTL1)
//CTL1CNTL DD *             
  OPTION COPY 
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
  IFTHEN=(WHEN=(1,9,CH,EQ,C'MONT 9926'), 
  OVERLAY=(81:81,8,ZD,SUB,+1,M11,LENGTH=8))         
                                                     
  OUTFIL BUILD=(1,80)                               
//*                                                 

And the following lines shows the DFSMSG STEP0100:


ICE146I 0 END OF STATEMENTS FROM CTL1CNTL - PARAMETER LIST STATEMENTS FOLLOW       
          DEBUG NOABEND,ESTAE                       
          OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL1,SORTIN=IN,SOR* TOUT=OUT,DYNALLOC,SZERO,EQUALS,NOVLSHRT,LOCALE=NONE,NOCH*                            ECK                                                         
          SORT FIELDS=(81,8,CH,A)                                                   
          MODS E35=(ICE35DU,12288)                                                   
ICE056A 9 CTL1OUT  NOT DEFINED                                                       
ICE751I 0 C5-Q95214 C6-Q95214 C7-BASE   C8-Q95214 E7-Q95214                         
ICE052I 3 END OF DFSORT                                                             

Thanks a lot.

Re: Specify a record and next of this record.

PostPosted: Mon Oct 08, 2012 1:02 pm
by NicC
When pasting stuff from your mainframe session please use the code tags. You find the button for these in the "Full Editor". coding preserves spacing so that we can determine elementary things such as the column that things start in and makes the stuff easier to read. I have coded your stuff for you.

Re: Specify a record and next of this record.

PostPosted: Mon Oct 08, 2012 9:55 pm
by skolusu
Mehdi shri wrote:
ICE751I 0 C5-Q95214 C6-Q95214 C7-BASE   C8-Q95214 E7-Q95214                         



You did not show us the complete DFSMSG. The above information message indicates that you are running an unsupported version of DFSORT. You are running z/OS DFSORT V1R5 with PTF UQ95214 which is released in December, 2004. DFSORT V1R5 is out of service. You need to get to the latest version of DFSORT.


Meanwhile try changing the OUTFIL statement in CTL1CNTL as shown below and re-run your job.

OUTFIL BUILD=(1,80)   

to

OUTFIL FNAMES=OUT,BUILD=(1,80)

Re: Specify a record and next of this record.

PostPosted: Mon Oct 08, 2012 10:19 pm
by Mehdi shri
Thank you friend.
It is run correctly and MAXCC=00
Thanks a lot.

Re: Specify a record and next of this record.

PostPosted: Tue Oct 09, 2012 7:54 pm
by dick scherrer
Hello,

Suggest you speak with your manager or technical support to have your SORT upgraded.

With what you have there are MANY features that will be unavailable to you. When you find an example that does exactly what you want and you cannot use it, it is quite frustrating.

There is also no good business reason to run products that are no longer supported. It is rather risky . . . fwiw.