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
 

 

Repeat read a file from starting after EOF using Selcopy

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
Ashish UK

New User


Joined: 19 Jun 2011
Posts: 2
Location: UK

PostPosted: Sun Jun 19, 2011 11:52 am    Post subject: Repeat read a file from starting after EOF using Selcopy
Reply with quote

Hi,

My requirement is :
Read a file again from the first record although the EOF (End Of File) condition is encountered while reading the same file (using Selcopy only).

Please let me know at the earliest with the selcopy code.


Thanks,
Ashish
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Sun Jun 19, 2011 12:10 pm    Post subject:
Reply with quote

Have you tried anything? When, at EOF, you CLOSE the file then OPEN it, does it give you what you want? Obviously watch out for the 2nd EOF, you won't want to do it forever.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Sun Jun 19, 2011 2:46 pm    Post subject: Re: Repeat read a file from starting after EOF using Selcopy
Reply with quote

Ashish UK wrote:
Please let me know at the earliest with the selcopy code.

A liitle more bluntly put than Bills comment above.

This is a HELP forum, not a DO MY PAID WORK FOR ME forum.

Now scuttle off and show us what you have achieved so far, and when we see evidence that you have tried to help yourself, feel free to ask for help from others.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Mon Jun 20, 2011 9:42 am    Post subject:
Reply with quote

Hello and welcome to the forum,

Why does someone believe the file needs to be "read again"?

As others have mentioned, we will help - but NOT simply do the work for you.
Back to top
View user's profile Send private message
Ashish UK

New User


Joined: 19 Jun 2011
Posts: 2
Location: UK

PostPosted: Mon Jun 20, 2011 11:59 am    Post subject: Reply to: Repeat read a file from starting after EOF using S
Reply with quote

Hi,

Thanks for the reply. But it does not solve the problem. The requirement is :

01. To read File-A which is having the Duplicate records & those are sorted. I have to keep the duplicate records.
02. Read another file (say, File-B which is not having duplicate records) to get some extra information for all the records of File-A (including the Duplicate records).
03. I am getting the output till encounters a duplicate record from File-A. When ever Selcopy encounters a dupliacte key for the File-A, it is getting the next record from File-B. As a result there is mismatch of records.
04. So, if there is a duplicate record in File-A, then i have to read the File-B once again form Starting.

So, if any way i can reset the pointer value to first record of File-B, i can get all the values from File-B.

Please reply.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Jun 20, 2011 12:12 pm    Post subject:
Reply with quote

I think it is not SELCOPY that is doing this, but the stuff that you type in to SELCOPY. Program only do what you tell them, the thing is to tell them to do the right thing (and assuming that the solution you have chosen is possible).

You have A, sorted, with duplicates.

You have B, sorted(?), without duplicates.

Since you mention a "key" that "Selcopy encounters", I assume you are using some feature of Selcopy (feel free to let us know, otherwise we can shoot away in the dark).

If you are using such a feature, make sure you understand exactly what it is doing. This can also involve some simple tests with various combinations, multiples on first, second, both. Try to work out how the feature works.

I'd just suspect that if you swap the files around you might get the answer you want. But test it out first as I've suggested.
Back to top
View user's profile Send private message
Dsingh29

Active User


Joined: 16 Dec 2008
Posts: 132
Location: IBM

PostPosted: Mon Jun 20, 2011 12:14 pm    Post subject:
Reply with quote

Hey Ashish,

Your latest post is not in sync with your first one. Anyways, there is still lack of clarity on your requirements.

1. How are you reading file-B, is there any key to identify which records corresponds to file-A.
2. Why do you want to read file-B from starting in case of duplicates, simply hold the previous record (file-B) when next record (file-A) is same (mean duplicate).
3. Suggest you should search the forum for "file match algorithm", i think that is what your requirement is.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Mon Jun 20, 2011 9:12 pm    Post subject:
Reply with quote

Hello,

Quote:
Your latest post is not in sync with your first one. Anyways, there is still lack of clarity on your requirements.


Quote:
Thanks for the reply. But it does not solve the problem. The requirement is :
There was no intention to provide "a solution". Until at least most of use have the same understanding of the complete requirement, any "solution" would most likely be a wild guess.

Quote:
04. So, if there is a duplicate record in File-A, then i have to read the File-B once again form Starting.
No, you dont. . . The method you have chosen is the worst possible alternative (it it will work at all). If you believe you must to this you do not understand one of the most basic 2-file processes. What you want is a 2-file, match-merge (some call this a line balance). At the top of the COBOL part of the forum is a "Sticky" containing tested working code. It has been downloaded a few thousand times and worked as desired for those who used it.
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 -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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