MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Copybook declaration working storage

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
anita_m
Beginner


Joined: 20 Sep 2006
Posts: 41
Topics: 12
Location: Venus

PostPosted: Mon May 21, 2007 1:09 pm    Post subject: Copybook declaration working storage Reply with quote

I have declared a copybook XXXPNAPS in the file section and also in the working storage in the following manner.

In data division
Code:

FD  REC-BASE.     
                   
    COPY XXXPNAPS.


In working storage
Code:

COPY XXXPNAPS                             
     REPLACING ==01 MY-RECORD.== BY
               ==01 WS-MY-RECORD.==
               ==M-== BY =WS-==.


On compiling it gives following error for the declaration done in working storage.
Code:

IGYDS0017-E "01" SHOULD BEGIN IN AREA "A".


Following is what I found in the dump of compile job.
Looks like the whole copy book after 01 level variable has shifted by a few bytes when declared in working storage. I am unable to find the reason for this.
Code:

---+----3----+----4----+----5----+----6----+----7----
            COPY XXXPNAPS.                                     
    ******************************************************
    *****  THIS IS TEMP BASE FILE COPYBOOK       
    ******************************************************
       01  MY-RECORD.                                   
             05  M-PROVIDER-KEY.                                 
                   10  M-PROVIDER-ID                 PIC 9(7).     
.
.
.
---+----3----+----4----+----5----+----6----+----7----+
      COPY XXXPNAPS                                           
               REPLACING ==01 PROVIDER-RECORD.== BY               
                                 ==01 WS-PROVIDER-RECORD.==               
                                 ==M-== BY ==WS-==.                       
     ******************************************************
     *****  THIS IS TEMP BASE FILE COPYBOOK       
     ******************************************************
             01 WS-RECORD.                             
                 05  M-PROVIDER-KEY.                                 
                       10  M-PROVIDER-ID                 PIC 9(7).
.
.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon May 21, 2007 1:44 pm    Post subject: Reply with quote

anita_m,

Try this

Code:

COPY XXXPNAPS REPLACING '01 MY-RECORD.' BY '01 WS-MY-RECORD.'.


and check these threads as to why your replace failed.

http://www.mvsforums.com/helpboards/viewtopic.php?t=6513&highlight=copy+replacing

http://www.mvsforums.com/helpboards/viewtopic.php?t=435&highlight=copy+replacing

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Tue May 22, 2007 3:35 pm    Post subject: Reply with quote

I was looking exactly how to use 'REPLACE' in PL/1.....what is the corresponding key-word in PL/1.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue May 22, 2007 3:45 pm    Post subject: Reply with quote

Quote:

I was looking exactly how to use 'REPLACE' in PL/1.....what is the corresponding key-word in PL/1.

vak255,

1. Click on "Quick Manuals" link on top of this page
2. Click on "Enterprise PL/I Language Reference" under PL/I manuals section
3. Click on and type Replace and click on SEARCH
4. read the first hit you got

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Tue May 22, 2007 3:51 pm    Post subject: Reply with quote

Thanks Kolusu. I serached help boards but not PL/1 manual as I am not sure of the word i am suppose to search, when I saw this post...I could not resist typing here.

I appreciate your help.
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed May 23, 2007 3:22 am    Post subject: Reply with quote

Note: the %REPLACE in PL/1 is was introduced in Version 3 (which is why I have not heard of it as we still run v2!)
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group