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

File copy procedure


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

Active User


Joined: 18 Jan 2010
Posts: 143
Location: Pune

PostPosted: Wed May 05, 2010 4:56 pm
Reply with quote

Hi,
Following is the dilemma i am facing:
I have my cobol db2 code:
Following is the step followed:
1. Read the VB - PS file
2. Based on the condition update the table and if update successful copy the record into output file for 20 times.
3. Above procedure should repeat for 20 times
4. If suppose number of records are less than 20 we need to rollback all the changes in the table.

My dilemma,
is there any procedure for step2, above.
if i define 2 output files.
File-1 will have records for every successful update.
if update count=20 can i copy those records into file-2,emptying file-1
else
if update<20 just empty the records from file-1.

If you provide your kind feedback it will be great
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Wed May 05, 2010 4:59 pm
Reply with quote

Hello Krunal,

I have a Question here. Why can you delete unwanted record from your input file in ur case record which have occurance less than 20 And then updated DB2 TABLE from newly createed file which will have all valid records.

Hope i have nt misunderstood the requirement.
Back to top
View user's profile Send private message
krunalbafna
Warnings : 1

Active User


Joined: 18 Jan 2010
Posts: 143
Location: Pune

PostPosted: Wed May 05, 2010 5:06 pm
Reply with quote

HI,
I am not deleting anything from input file.
My input file is having 50lacs records.
I cannot chk for each occurance.

What my programs wants if read records from file for particular occurances,update the tally table.
Repeat for twenty times.
If it successfully happens write those 20 records to output file..

So i had an idea of copying records from output file-1 to file-2
if upd-cnt = 20 than copy records from file-1 to file-2
else empty file-1 for next occurances
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Wed May 05, 2010 5:09 pm
Reply with quote

Hello Krunal,

Its bit confusing. Do you have 20 records for each valid key yes or no?
Can you provide one sample input file ?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed May 05, 2010 9:19 pm
Reply with quote

Hi Ekta,

TS has posted this multiple times with slightly different wording. . .

It appears that some solution has already been chosen and the forum topics are an attempt to get the solution to be usable (rather than creating a different solution that would be easy t implement).

As you suggest, "queueing" the records and then writing the output only when appropriate would be a very good solution (IMHO) icon_smile.gif

d
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed May 05, 2010 9:23 pm
Reply with quote

Quote:
TS has posted this multiple times with slightly different wording. . .


and every time has added confusion !
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 How to split large record length file... DFSORT/ICETOOL 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top