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
 

 

COPY REPLACING - different prefixes

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

New User


Joined: 28 Aug 2006
Posts: 27
Location: NY, US

PostPosted: Sat Oct 28, 2006 1:44 am    Post subject: COPY REPLACING - different prefixes
Reply with quote

Hi all,

I have this copy book which has two different prefixes. How do I replace each prefix with a different string.

This is the copy book.
05 :A03:-POS1.
10 :A03:-PRODUCT PIC X(3).
10 :A03:-CLIENT PIC X(3).

05 :A05:-POS1 REDEFINES :A03:-POS1.
10 :A05:-PRODUCT PIC X(3).
10 :A05:-CLIENT PIC X(3).


Now in cobol I replaced them as below
COPY copybook REPLACING ==:A03:== BY ==NEW==,
==:A05:== BY ==OLD==.

Now this gives me error.

Can someone tell me what's wrong and how exactly I should do this?

Thanks in advance,
Daphne
Back to top
View user's profile Send private message

MFRASHEED

Active User


Joined: 14 Jun 2005
Posts: 186
Location: USA

PostPosted: Sat Oct 28, 2006 2:12 am    Post subject: Re: COPY REPLACING - replacing different prefixes.
Reply with quote

What error message are you getting?

Looks nothing wrong with COPY statement you have it should work if there is a preceding 01 level before copybook declaration.
Back to top
View user's profile Send private message
Daphne

New User


Joined: 28 Aug 2006
Posts: 27
Location: NY, US

PostPosted: Sat Oct 28, 2006 3:05 am    Post subject: Re: COPY REPLACING - replacing different prefixes.
Reply with quote

Hi,

Thanks for the reply.
I am getting the following error message.

IGYDS1089-S "REPLACING" was invalid.


Yes I have the 01 level before copy.

Thanks,
Daphne
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Sat Oct 28, 2006 3:33 am    Post subject: Re: COPY REPLACING - replacing different prefixes.
Reply with quote

Daphne,

worked file for me. What compiler version are you using?

Code:

01  DATA-RECORD-1.                               
    COPY TESTCB1 REPLACING ==:A03:== BY ==NEW==,
         ==:A05:== BY ==OLD==.                   
    05 NEW-POS1.                                 
    10 NEW-PRODUCT PIC X(3).                     
    10 NEW-CLIENT PIC X(3).                     
    05 OLD-POS1 REDEFINES NEW-POS1.             
    10 OLD-PRODUCT PIC X(3).                     
    10 OLD-CLIENT PIC X(3).                     


Dave
Back to top
View user's profile Send private message
Daphne

New User


Joined: 28 Aug 2006
Posts: 27
Location: NY, US

PostPosted: Mon Oct 30, 2006 7:55 pm    Post subject: Re: COPY REPLACING - replacing different prefixes.
Reply with quote

Hi,

Fault was mine. I had missed a blank there. It is working fine now.

Thank you guys for your time.

Daphne
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 replacing junk with hyphen Nitin32 DFSORT/ICETOOL 10 Fri Jun 02, 2017 7:47 pm
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 7 Thu Apr 27, 2017 1:15 am
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm


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