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

Need LOGIC to read only FIRST(Header) & Last(Trailer) Re


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dharmendra_kp

New User


Joined: 10 Mar 2005
Posts: 33
Location: Lewiston

PostPosted: Mon Nov 21, 2005 11:23 am
Reply with quote

Hi All,
I will appreciate if any one provides me logic to read only first and last record i.e. Header & Trailer record of a PS FILE, for validation purpose.
There is no record count in header file and since file size is very big I want to avoid reading detailed records, if the content of header and trailer records are not proper there should not be processing on the detailed record.

I will appreciate if members provide me quick reply.

Email: ***EMail ID REMOVED... Use CODE tag to include mail id***
Back to top
View user's profile Send private message
Phantom

New User


Joined: 04 Sep 2005
Posts: 25

PostPosted: Mon Nov 21, 2005 3:59 pm
Reply with quote

dharmendra_kp,

How many Header-Data-Trailer pairs do you have ?

1. If you have only one Header-Trailer then you can probably sort the input file before processing so that Trailer record comes before data.

2. Since you said that ur input file is huge, SORTING will not be efficient. Instead using SORT, you can separate the trailer record alone into a separate file and pass it as one more input to your cobol program. If this second input file contains valid info. then process your full file which contains the data.

For example, if you have TRAILER in the first 7 bytes of your trailer record then use the Sort card below to separate the record into a new file.
Code:

   SORT FIELDS=COPY
   INCLUDE COND=(1,7,CH,EQ,C'TRAILER')


Hope this helps,

Thanks,
Phantom
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
Search our Forums:

Back to Top