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
 

 

Write and read the KSDS file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
raviprabhu

New User


Joined: 20 Oct 2006
Posts: 29

PostPosted: Sat Dec 28, 2013 1:45 am    Post subject: Write and read the KSDS file
Reply with quote

Hi,

I have written program to read a file and write to KSDS file, after writing each record to KSDS file the record should be read and write to another flat file and delete the records from KSDS file.

process should be like this
input file
1st rec
2nd rec
3rd rec
4th rec
5th rec
6th rec

I have to read the input file from 1st to 3rd rec and write to KSDS file and as soon as I write to KSDS, the same records should be read from 1st to 3rd rec and write to flat file and delete from KSDS file.

While doing this in my program, I am able to write records to KSDS file but after reading KSDS only the 3rd rec is getting written to flat file and getting deleted from KSDS

How do I process this ?


Regards
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Sat Dec 28, 2013 1:58 am    Post subject: Reply to: Write and read the KSDS file
Reply with quote

You are writing records to a KSDS just to write them to a sequential file and delete them from the KSDS? Why?
Back to top
View user's profile Send private message
raviprabhu

New User


Joined: 20 Oct 2006
Posts: 29

PostPosted: Sat Dec 28, 2013 2:29 am    Post subject:
Reply with quote

I am actually resorting the records
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Sat Dec 28, 2013 2:49 am    Post subject:
Reply with quote

Why not simply sort the input and create the output. Am I missing something?
Back to top
View user's profile Send private message
raviprabhu

New User


Joined: 20 Oct 2006
Posts: 29

PostPosted: Sat Dec 28, 2013 5:48 am    Post subject:
Reply with quote

using sort will have performance issues..since the records processing are more that 40 million
So need to do through program
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Sat Dec 28, 2013 7:34 am    Post subject: Reply to: Write and read the KSDS file
Reply with quote

Really? Do you know how much time it is going to waste writing a record to a KSDS just for you to delete it later? And you think SORT is going to be slower? If that were so, then that is how SORT would do a sort, don't you think?

Try it. Try SORTing 40m records. Try just writing 40m records to a KSDS, let alone deleting them, or writing them anywhere else. Let us know.
Back to top
View user's profile Send private message
raviprabhu

New User


Joined: 20 Oct 2006
Posts: 29

PostPosted: Sat Dec 28, 2013 7:37 am    Post subject:
Reply with quote

I need the solution for my program, sorry I do not have time..
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Sat Dec 28, 2013 7:44 am    Post subject: Reply to: Write and read the KSDS file
Reply with quote

You don't have time to find out if your approach is reasonable?

Do you have time to set out fully and exactly what it is that you are doing? If not, I'm not sure how anyone can help.

Note: SORT is very, very good at IO. A KSDS through a COBOL program is not so hot. If you don't believe that, then your "performance" issue will bite you once you get to volume testing at the latest.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Sat Dec 28, 2013 10:17 am    Post subject:
Reply with quote

raviprabhu wrote:
I need the solution for my program, sorry I do not have time..

Do you want someone to write program for you free??? icon_eek.gif icon_eek.gif

by the way I have many sort applications processing over 600 million records everyday and they do quite smoothly...
Back to top
View user's profile Send private message
raviprabhu

New User


Joined: 20 Oct 2006
Posts: 29

PostPosted: Sat Dec 28, 2013 8:56 pm    Post subject:
Reply with quote

I just need after as soon as the records (1st to 3rd rec) written to KSDS file I need to read the record from 1st rec from KSDS file and then again read the flat file from 4th rec.
I just need to know how to read the KSDS file from 1st rec as of now it is reading the 3rd rec.

Sorry but my client has given instructions to write the program instead of SORT
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Sat Dec 28, 2013 9:16 pm    Post subject: Reply to: Write and read the KSDS file
Reply with quote

Well, which is it?
Quote:

using sort will have performance issues


or

Quote:
my client has given instructions to write the program instead of SORT


or

"my client has given instructions to write the program instead of SORT because using sort will have performance issues"?

Has your client also told you not to use WORKING-STORAGE? Why the KSDS? To write records to it, read them, then delete them, is "overhead" and you will have 40,000,000 chunks of overhead.

Read all the records which make up a "group", storing them. At the end of the "group", do your processing, outputting what you want.

You may be able to do this as a "sub-group" and not need to store all the records. We don't know.

Storing them on a KSDS is a waste of resources. OK, Client pays. But will it run well enough? For what you want to do (use file IO on a KSDS) vs what you could do (just use memory) there is going to be a pretty big difference in performance.

How do you read the first record you wrote on the KSDS? With its key. You have READ with a key, which needs a full key, and START which can take a partial key which will allow a sequential READ to get the first record which matches the partial key.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Sun Dec 29, 2013 7:14 pm    Post subject:
Reply with quote

Many shops, to accomplish a simple file copy, translate an IEBGENER step to SORT because of its speed. That should tell you something.
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: Sun Dec 29, 2013 10:26 pm    Post subject:
Reply with quote

Hello,

Also, many shops run Sort "under the covers" when IEBGENER is invoked. Sort is exponentially faster.

For giggles try to run a COBOL program to insert only 1 million random records into the VSAM file. Then sort the same 1 million records into the VSAM file.

Look at the difference in the cpu used and the I/o needed.

Just because the client pays the bill, does not mean they have knowledge. . . The trick is demonstrating this to them without making them look bad.
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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