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 Need help in building a logic Benchwarmer All Other Mainframe Topics 4 Wed Feb 22, 2017 2:49 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts CICS VSAM RLS READ akodakka CICS 3 Tue Oct 04, 2016 3:09 pm
No new posts Wildcard logic in COBOL dudenithy COBOL Programming 13 Thu Sep 01, 2016 7:36 pm
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am


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