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
 
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: 6968
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts XMITIP sends it out. Can it copy on l... Rommel Dayon Rustia IBM Tools 0 Tue Sep 05, 2017 10:16 am
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm

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