View previous topic :: View next topic
|
Author |
Message |
nithivenkat
New User
Joined: 15 Sep 2008 Posts: 22 Location: Mumbai
|
|
|
|
Hi,
My file has first 3 records as header.
Say for example if the total records in my file is 10, then the first 3 records will be headers and the remaining 7 will be detail records.
Now in my JCL - sortparm I have to extract only the detail records which will be processed in my cobol program.
Since we are not sure of the data in the header, we are simply skipping the first 3 records like below.
SORT FIELDS=COPY,SKIPREC=3
END
The output of this file (generated based onabove sort) is used in my cobol program.
My program does a check if the input file is empty [in the sense if the original input file has only headers and are skipped] it should abend. But it is not abending because of some junk being present. Can some one help me how to resolve this problem.
Kindly advise. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hi,
Can you show us how the input file looks like & the scenarios. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Define junk |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
and why are you wasting resouces to delete 3 records from a file,
that could be skipped by the cobol program.
and what do you mean by ABEND?
If you keep the 3 headers in the file,
that means the COBOL program will always have a file to read,
and starting with the 4th read, if end of file, issue a non-zero return code.
If you are using the old rookie trick of forcing an abend in a module,
you are again (second time) wasting resources. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Can some one help me how to resolve this problem. |
Maybe. . . You need to post more complete information.
As Expat mentioned - define junk.
As Vasanth requested - show the input data and post the rules.
You need to post the jcl and control statements and mention what abbend is happening.
If you won't post much, we can't help much. . . |
|
Back to top |
|
|
|