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
 

 

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: 755
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: 755
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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