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
 

 

File copy procedure

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: File copy procedure
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: 1187
Location: Bangalore,India

PostPosted: Wed May 05, 2010 4:59 pm    Post subject:
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    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Wed May 05, 2010 5:09 pm    Post subject:
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

Site Director


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

PostPosted: Wed May 05, 2010 9:19 pm    Post subject: Reply to: File copy procedure
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Wed May 05, 2010 9:23 pm    Post subject: Reply to: File copy procedure
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    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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
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


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