Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 10326
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us