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

How to externally abend an running SORT jcl.


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

New User


Joined: 29 May 2007
Posts: 22
Location: Pune

PostPosted: Mon Sep 03, 2007 3:15 pm
Reply with quote

Hi All

I have an JCl with three steps.

In the first step it is having an input file which contains some 500 records.and i am selecting only first two records to process at one time

Second step is an SORT step where i am removing the first two (By using SKIPREC = 2) and i am overwriting the same input file , as a result now the input file will have some 498 records to process.

In the third Step i am calling an JCL (By using INTRDR) which is the copy of the First JCL so contains all the above mentioned three steps.

Now the problem i am facing is from JCL A i am Calling JCL B and From JCL B again i am calling JCL A, so in the procesing part when first JCL wil run foir the first time it will process only first two records and also the record processed will than be removed in the second step.

Now in the second JCL B it will have another first two records to process , it wil process them and these two wil be further5 removed and again JCL A will be called again in JCL B.

Now the Problem is JCL A wil keep calling JCL B and JCL B will KEEP calling JCL A , in this way al the 500 records wil be processed but the Problem comes when al the records are completed it wil not stop at all and it will keep executing without any records..

So here what i am thinking is there any way so that we can provide an external Abend in SORt Step once all the records are completed (means there is no record in the Input sort file..?

Here is the JCL what i am using ..

//JS010 EXEC Environment
//CMPRT01 DD SYSOUT=X
//CMWKF01 DD DSN=Input-->(PS File contains alphanumeric record NNNNNNNNNA, where N is the numeric and last alphabet is 'A')
// DISP=SHR
//CMSYNIN DD DSN=PGM --> (This contains the PGM logic in NATURAL language, here the records will get processed),
// DISP=SHR
//**--------------------------------
//JS020 EXEC PGM=SORT,PARM='AVGRLEN=10' --> (in the Step i am removing the First two processed records)
//**--------------------------------
//SYSOUT DD SYSOUT=A
//SORTIN DD DSN=Input,
// DISP=SHR
//SORTOUT DD DSN=Input,
// DISP=SHR
//SYSIN DD *
SORT FIELDS=(1,10,CH,A),SKIPREC=2
INCLUDE COND=(10,1,CH,EQ,C'A')
/*
//JS030 EXEC PGM=IEBGENER--> in this step i am calling anopther JCL which is the copy of this JCL itself , with the changed name of JCl in INTRDR step)
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=AVE0433.EDSTEST.GOURAV4(JCL5),DISP=SHR
//SYSUT2 DD SYSOUT=(A,INTRDR)
//SYSIN DD DUMMY



Please suggest me if there is some way to come out of this LOOP Condition.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Sep 03, 2007 3:20 pm
Reply with quote

nemaji,

Using utility (like ICEMAN..) verify for empty file and execute the code for a non-empty file.
Back to top
View user's profile Send private message
nemaji

New User


Joined: 29 May 2007
Posts: 22
Location: Pune

PostPosted: Mon Sep 03, 2007 3:34 pm
Reply with quote

I have tried giving the ICEMAN instead of SORT and initially given the Four records and ran it two times so that the Input file becomes enpty, but when i had tried running this for the third time it should give the abend as the input file is empty now , but still it is going on with MACC = 0 .

So is there some options what i should have to mentione with ICEMAN..in the SORT Step?
Back to top
View user's profile Send private message
nemaji

New User


Joined: 29 May 2007
Posts: 22
Location: Pune

PostPosted: Mon Sep 03, 2007 3:36 pm
Reply with quote

Here is my sort step what i am trying right now.


//JS020 EXEC PGM=ICEMAN
//**--------------------------------
//SYSOUT DD SYSOUT=A
//SORTIN DD DSN=Input,
// DISP=SHR
//SORTOUT DD DSN=Input,
// DISP=SHR
//SYSIN DD *
SORT FIELDS=(1,10,CH,A),SKIPREC=2
INCLUDE COND=(10,1,CH,EQ,C'A')
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Sep 03, 2007 3:44 pm
Reply with quote

nemaji,

Sorry it is ICETOOL not ICEMAN as mentioned in my prev post.

From the link download the pdf www.ibm.com/servers/storage/support/software/sort/mvs/tricks/ and use the topic Set RC=12 or RC=4 if file is empty, has more than n records, etc for verifing the # of records in the file (please note even you could use IDCAMS for this). When you get an empty file, break the loop.
Back to top
View user's profile Send private message
nemaji

New User


Joined: 29 May 2007
Posts: 22
Location: Pune

PostPosted: Mon Sep 03, 2007 4:58 pm
Reply with quote

Thanks a lot Murli I canged this ICEMAN to ICETOOL and used Count option of this and it is working for me now...

I was really got stuck with this since last week and now i finally got the answer..

Thanks for your assistance...
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Sep 03, 2007 9:18 pm
Reply with quote

nemaji wrote:
i finally got the answer...

Hi,

Good to know that you've got the desired result icon_smile.gif .

Here, I would like to suggest one thing, it's a good practice to share the final solution, when you got the ultimate one for your need. This will help better in future for them who'll look/search this thread after some time, for similar kind of problems.

BTW, with IDCAMS, you can use below JCL
Code:
//********************************************
//* FILE NOT EXISTING :  RC = 12             
//* EMPTY FILE        :  RC = 04             
//* DATA FILE         :  RC = 00             
//********************************************
//STEP010  EXEC PGM=IDCAMS                   
//SYSUDUMP DD SYSOUT=C                       
//SYSOUT   DD SYSOUT=*                       
//SYSPRINT DD SYSOUT=*                       
//FILEIN   DD DSN=HLQ.FIRST.FILE,DISP=SHR
//SYSIN    DD *                               
  PRINT INFILE(FILEIN) -                     
      CHARACTER COUNT(1)                     
/*                                           
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: Mon Sep 03, 2007 9:53 pm
Reply with quote

Actually, you can do this with DFSORT rather than DFSORT's ICETOOL using the NULLOUT=RC16 or NULLOUT=RC4 option. You can even make it abend rather than giving RC=16 with the ABEND option. For example:

Code:

  SORT FIELDS=(1,10,CH,A),SKIPREC=2
  INCLUDE COND=(10,1,CH,EQ,C'A')
  OPTION NULLOUT=RC16
  DEBUG ABEND   - if you want an abend -
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Running REXX through JOB CLIST & REXX 13
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts ISAM and abend S03B JCL & VSAM 10
Search our Forums:

Back to Top