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

regarding the copybook with replace syntax


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

New User


Joined: 10 Nov 2004
Posts: 2
Location: pune

PostPosted: Wed Nov 10, 2004 1:46 pm
Reply with quote

01 CARPICK-RECORD.
05 LOCATION-KEY PIC X(3).
05 DATE-KEY PIC X(6).
05 ORDER-NBR-KEY PIC X(20).
05 ITEM-DUPE-KEY PIC X(3).
* 05 COPY IDMS RECORD ICSDNLOD.
copy ICSDNLOD

here i want to put the copybook ICSDNLOD and comment that COPY IDMS RECORD ICSDNLOD.
but the copybook variables are starting like this.
01 ICSDNLOD.
05 LOC-CD PIC X(03) VALUE SPACES.
05 DNLOAD-DT PIC 9(06).
05 CARSEL-ORD-NBR PIC X(20).

I tried with the replace option?.
COPY ICSDNLOD REPLACING ==01 ICSDNLOD == BY ==05 ICSDNLOD ==
==05 ICSDNLOD == BY ==10 ICSDNLOD == .

but this is replacing all the pic x(05) with pic x(10).

Please let me know any other way of this replace syntax or any other way to do.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Nov 11, 2004 12:30 am
Reply with quote

Hi Sri,

Give this a try:
Code:
 
COPY ICSDNLOD REPLACING  ==01 ICSDNLOD.==  BY  ====.

If that doesn't work, try:
Code:
 
COPY ICSDNLOD REPLACING  ==01 ICSDNLOD.==  BY  == ==.

In either case make sure you use the correct number of spaces in the 01 stmt you're attempting to change, JIC.

If it works, this will nullify the 01 stmt ("01 ICSDNLOD."), therefore the following 05s, etc. will be appended to 01 CARPICK-RECORD and become part of it. I think this is what you're looking for.
Back to top
View user's profile Send private message
sri ranganath

New User


Joined: 10 Nov 2004
Posts: 2
Location: pune

PostPosted: Thu Nov 11, 2004 11:10 am
Reply with quote

Thanks very much for posting....

This syntax is working fine....

COPY ICSRGKYC REPLACING == 01 == BY == 05 ==
==(01)== BY ==(01)==
== 05 == BY == 10 ==
==(05)== BY ==(05)==
== 10 == BY == 15 ==
==(10)== BY ==(10)==
== 15 == BY == 20 ==
==(15)== BY ==(15)==
== 20 == BY == 25 ==
==(20)== BY ==(20)==.
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
Search our Forums:

Back to Top