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.
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: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
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.
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
nemaji wrote:
i finally got the answer...
Hi,
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.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
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 -