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')
//CMSYNIN DD DSN=PGM --> (This contains the PGM logic in NATURAL language, here the records will get processed),
//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,
//SORTOUT DD DSN=Input,
//SYSIN DD *
//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.
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?
Joined: 22 Apr 2006 Posts: 6258 Location: Mumbai, India
i finally got the answer...
Good to know that you've got the desired result .
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.