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

Overriding copy book variables


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

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Fri Apr 25, 2008 9:24 am
Reply with quote

I have a copybook "HELLO"

Which has 01 bcd
05 bcx pic 9(4)
05 bcr pic x(4) ….etc

But I want the copy book to expand as shown when I compile it…..

01 bcd-X
05 bcx-X pic 9(4)
05 bcr-X pic x(4) ….etc
i.e it should be suffixed with ‘-X’

Can anyone help me in this...

Nelson
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Fri Apr 25, 2008 10:41 am
Reply with quote

nelson.pandian wrote:
I have a copy book say HELLO

Which has 01 bcd
05 bcx pic 9(4)
05 bcr pic x(4) ….etc

But I want the copy book to expand as shown when I compile it…..

01 bcd-X
05 bcx-X pic 9(4)
05 bcr-X pic x(4) ….etc
i.e it shud be suffixed with ‘-X’

Can any one help me in this...

Thanks in advance,
Nelson


Code:

If ur copy book is like this ie having common qualifier.

01 copy1-bcd
    05  copy1-bcx           pic 9(4)
    05  copy1-bcr            pic x(4) ….etc 

Then u can replace copy1 with copy1-x in ur program.Then u can see

01 copy1-x-bcd
    05  copy1-x-bcx           pic 9(4)
    05  copy1-x-bcr            pic x(4) ….etc  in ur compiler listings
Back to top
View user's profile Send private message
nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Fri Apr 25, 2008 2:50 pm
Reply with quote

I think you didn't get me.
Say for Example:
In ADSO we can Prefix or Suffix a variable which is present a record in IDDM, and we can use those prefixed or suffixed variable in the dialog.

IDDM structure:
Prefix variable: WS01-

01 REF
02 REC1 PIC X(02)
02 REC2 PIC X(02)

While using in a dialog we use to use as WS01-REC1 and WS01-REC2.

In the same way can we use the variables with a prefix or Suffix which is in the Copybook used by a Cobol Program.
Back to top
View user's profile Send private message
nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Fri Apr 25, 2008 2:54 pm
Reply with quote

Is there anyothere way of using the Prefix or Suffix with Replace or Redefine or Renames, something like.
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: Fri Apr 25, 2008 7:25 pm
Reply with quote

nelson.pandian wrote:
Is there anyothere way of using the Prefix or Suffix with Replace or Redefine or Renames, something like.
No, whole woeds only....
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Apr 28, 2008 8:10 pm
Reply with quote

Hi Nelson,

This should work.

In copybook:

01 bcd:suf:.
05 bcx:suf: pic 9(4).
05 bcr:suf: pic x(4).

In pgm:

copy hello replacing ==:suf:== by ==-x==.

If you don't want the -x, code:

copy hello replacing ==:suf:== by ====.
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 VB to VB copy - Full length reached SYNCSORT 8
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts DB2 Table - Image copy unload IBM Tools 2
No new posts How to copy the -1 version of a membe... TSO/ISPF 4
Search our Forums:

Back to Top