Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Need LOGIC to read only FIRST(Header) & Last(Trailer) Re
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts Read of TDQ fails in LENGERR Tracy Hansen CICS 10 Wed Apr 05, 2017 12:10 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us