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
 
Need to replicate a line (for ex) in a input file

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

New User


Joined: 26 Feb 2006
Posts: 38

PostPosted: Mon Nov 20, 2006 2:57 pm    Post subject: Need to replicate a line (for ex) in a input file
Reply with quote

Hi,

I need to replicate a line (for ex) in a input file make some changes to second line and write both the lines to output file.


Input file
xxxxxxxx yyyyyyyy zzzzzzzz

Output File:
xxxxxxxx yyyyyyyy zzzzzzzz
xxxxxxxx yyyyyy12 zzzzzz34

That is the first row has the same value and the second row with a different one.

Read file into IN-REC.
MOVE IN-REC TO OUT-REC.
WRITE OUT-REC.
MOVE ?12? TO INREC(16:2)
MOVE ?34? TO INREC(X:Y)
WRITE OUT-REC.

My question is :

When we write OUT-REC ONCE will the value be lost again do we need to move the value from IN_REC?
Back to top
View user's profile Send private message

guptae

Moderator


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

PostPosted: Mon Nov 20, 2006 3:03 pm    Post subject:
Reply with quote

Hi SSR,

Value wont lost. Again u have to initialize it to move different record in it .
Back to top
View user's profile Send private message
vijay_bn79

New User


Joined: 20 Nov 2006
Posts: 48
Location: Hyderabad

PostPosted: Mon Nov 20, 2006 3:14 pm    Post subject:
Reply with quote

Hi..,

yes.., Guptae is correct..., value wont lost unless you moved other value to out-rec or initialize that out-rec


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

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Mon Nov 20, 2006 3:37 pm    Post subject:
Reply with quote

Hi !

By reading both files in a matching-record-key function, you have always
three conditions to handel.

File-1-Key = File-2-Key ...do something then read both files
File-1-Key > File-2-Key ...read file-2 compare again
File-1-Key < File-2-Key ...read file-1 compare again

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

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Mon Nov 20, 2006 3:39 pm    Post subject:
Reply with quote

Sorry , this was the answer to an other question.
UmeySan
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Nov 20, 2006 5:37 pm    Post subject: Re: Need to replicate a line (for ex) in a input file
Reply with quote

if the output file is double buffered or blocked, the data is gone.
Back to top
View user's profile Send private message
SSR
Warnings : 1

New User


Joined: 26 Feb 2006
Posts: 38

PostPosted: Mon Nov 20, 2006 5:39 pm    Post subject: Thank you
Reply with quote

Hi all,

thank you.

Regards
SSR
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 COB2 file processing rizwanaccy COBOL Programming 8 Tue Jan 02, 2018 1:00 pm
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
No new posts Preserve order in Input File pshongal DFSORT/ICETOOL 13 Thu Dec 21, 2017 4:20 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am

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