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
 

 

This is about COPY REPLACING OPTION

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

New User


Joined: 24 Jan 2007
Posts: 1
Location: chennai

PostPosted: Tue Apr 10, 2007 9:55 am    Post subject: This is about COPY REPLACING OPTION
Reply with quote

Hi,

I have a COPYBOOK for input layout whose length in total is 2355. And i have two output files whose layout is same as input .My requirement is that i need to use only single copybook for three of them.Could you please help me how to declare that in the program.

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

guptae

Moderator


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

PostPosted: Tue Apr 10, 2007 10:03 am    Post subject:
Reply with quote

Hi Siva,

Please read forum rules.Do not shout.
Let's take your copybook name as COPYA which is declared as below
Code:
     01  COPYBOOK-A.
           10 COPYA-POLICY         PIC X(11).
           --


Then we can use

Code:
COPY COPYA                               
     REPLACING COPYBOOK-A BY FIRST-FILE.
COPY COPYA                               
     REPLACING COPYBOOK-A BY SECOND-FILE.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Mon Jan 14, 2008 12:35 pm    Post subject:
Reply with quote

But this is not a good option ekta. In the program you would have to use var-1 of first-file to associate variable with first-file and similalrly for second-file. Can't we have a better option than this ?
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Mon Jan 14, 2008 12:44 pm    Post subject:
Reply with quote

niks,

You are replying to year old (nearly) topic. If you have something to ask, why dont you start new topic?
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Mon Jan 14, 2008 1:28 pm    Post subject:
Reply with quote

I was just going thru some old topics. I thought why not pick this one as I thought the answer was not very impressive.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jan 14, 2008 1:34 pm    Post subject:
Reply with quote

niks_jude,
your answer was impressive. It showed what little experience you have.

as far as the OP's question, guptae's answer was very good and is a normal solution for this situation.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Jan 15, 2008 12:55 am    Post subject:
Reply with quote

This is a better answer:

Code your copybook variable/condition names with prefixes, e.g.:

02 :PFX-:FILE.
05 :PFX-:FLD1 PIC X.
88 :PFX-:OEF VALUE 'E'.
etc.

In your pgm code:

01 IP-FILE-1.
COPY SAMECBK REPLACING ==:PFX-:== BY ==IP1-==.
01 OP-FILE-1.
COPY SAMECBK REPLACING ==:PFX-:== BY ==OP1-==.
01 OP-FILE-2.
COPY SAMECBK REPLACING ==:PFX-:== BY ==OP2-==.

All the fields in IP-FILE-1 will begin w/IP1-
All the fields in OP-FILE-1 will begin w/OP1-
All the fields in OP-FILE-2 will begin w/OP2-

PS It's been a while so the syntax may not be 100%.
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 BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am


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