IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem in Copybook with Replacing option


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
obulisankar

New User


Joined: 03 May 2007
Posts: 20
Location: bangalore

PostPosted: Tue Apr 29, 2008 11:50 am
Reply with quote

I'm getting compilation error, when i try using
COPY Copybook1 REPLACING ==WS-TRIAL== BY ==WS-TRIALS==.

Copybook1
01 WS-TRIAL PIC X(5).

Actually the copybook named copybook1 is not getting expanded when i used Replacing option. i'm getting complilation errors for all other varibles used inside the copybook.

Any tips/suggestions would be of great help.....
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Tue Apr 29, 2008 1:10 pm
Reply with quote

Hi !

There are certain rules you need to take care of.

Example in Programm:

COPY TBBK206R
REPLACING ==PRE:==
BY ==G6B-==.

Example CopyBook:

01 PRE:GKTO-AZ6-BTAG.
10 PRE:INR PIC S9(4) COMP.
10 PRE:KONTO-ID PIC X(26).


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

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Apr 29, 2008 1:14 pm
Reply with quote

Hi,

Which product (CHGMAN or ENDEVOUR) do you use to compile program ?
Back to top
View user's profile Send private message
obulisankar

New User


Joined: 03 May 2007
Posts: 20
Location: bangalore

PostPosted: Tue Apr 29, 2008 3:25 pm
Reply with quote

Thanks for ur comments...


I'm using CHGMAN for compiling program, COBOL370 is the version i'm using.

Copybook is getting expanded for COPY Copybookname.

If i use COPY Copybookname REPLACING ==TESTA== BY ==TESTB==.
or, COPY Copybookname REPLACING TESTA BY TESTB.
It is not getting expanded, this is the problem i'm facing.
Back to top
View user's profile Send private message
jithumohan

New User


Joined: 31 Jan 2008
Posts: 30
Location: Woodland Hills, CA

PostPosted: Tue Apr 29, 2008 3:40 pm
Reply with quote

Is the copybook is available in the package or it is in any production libraries?
Back to top
View user's profile Send private message
rpuhlman

New User


Joined: 11 Jun 2007
Posts: 80
Location: Columbus, Ohio

PostPosted: Tue Apr 29, 2008 4:01 pm
Reply with quote

Please refer to this link: Replacement and comparison rules
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Apr 29, 2008 6:27 pm
Reply with quote

Hi obuli,

I used "REPLACING WS-TRIAL BY WS-TRIALS" and == ==
and it works OK.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Apr 29, 2008 11:48 pm
Reply with quote

Hi,
Quote:
Copybook is getting expanded

Where do You "look" for expended copybook, in compile listing or do you expend it in program itself using some macro/tool?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Apr 30, 2008 12:59 am
Reply with quote

Quote:
I used "REPLACING WS-TRIAL BY WS-TRIALS" and == ==
and it works OK.
It's good for ECOBOL, but maybe not for his level...
Example: enhancing XML output is a good example of full word replacing.......
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Apr 30, 2008 8:06 pm
Reply with quote

Replacing words in a copybook has been around for a looong time. Unless he's not using an IBM compiler.

Obuli,

Why don't you give us the environmental info and msg texts, etc.?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top