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

Arriving at junk values in my file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nithivenkat

New User


Joined: 15 Sep 2008
Posts: 22
Location: Mumbai

PostPosted: Sat Nov 14, 2009 6:13 pm
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Sat Nov 14, 2009 6:52 pm
Reply with quote

Hi,

Can you show us how the input file looks like & the scenarios.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat Nov 14, 2009 8:01 pm
Reply with quote

Define junk
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Nov 14, 2009 10:12 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Nov 14, 2009 10:13 pm
Reply with quote

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
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top