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

Invalid DEFINED - string overlay


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Sun Mar 11, 2012 5:13 pm
Reply with quote

Hi Friends,

While compiling a program (from PL/I for MVS & VM to Enterprise PL/I for z/OS Conversion) , I am getting the below error:


Code:

- Compiler Messages                                                             
0 Message     Statement  Message Description                                   
0 IBM1385I E          9  Invalid DEFINED - string overlay defining attempted. 
 


Below is extract of statement (line no 9 ) having error
Code:

2  1         DCL B FIXED(1);               
3  1         DCL A PTR;                                 
4  1         DCL (ADDR, VERIFY, DATETIME) BUILTIN;         
5  1         A = ADDR(B);                         
6  1         DCL WRKAREA CHAR(48) BASED(A);             
7  1         DCL ABC CHAR(48);                         
8  1         ABC = WRKAREA;                           
9  1          DCL 1 DATRET DEF ABC,                   
                   2 DANUM FIXED BIN(31,0) UNALIGNED,   
                   2 WKDANUM PIC '9',             
                   2 DANAME CHAR(9),               
                   2 MONAME CHAR(9),             
                                                 
                   2 MO PIC '99',                 
                   2 DA PIC '99',                 
                   2 YR PIC '9999',               
                   2 DAYR PIC '999',             
                                                   
                   2 HOURS PIC '99',             
                    .   
                         .
                    .



Is the below fix appropriate correction for the line no 9 ?

Code:
DCL 1 DATRET BASED(ADDR(ABC)),


Thanks,
Ajay
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Sun Mar 11, 2012 5:55 pm
Reply with quote

1) Why do you base a big workarea on a "fixed (1)"???
2) RTFM, especially about new features of Enterprise PL/I, such as "UNION"s, which almost completely remove the need for "DEFINED" and "BASED" and allow the compiler to

a) generate (much) better code and
b) do far more error-checking at compile-time
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Sun Mar 11, 2012 7:06 pm
Reply with quote

Thanks Prino!!

Well! this time I used "Union" instead of "DEF" and replaced below code with later code:

Code:

2  1         DCL B FIXED(1);               
3  1         DCL A PTR;                                 
4  1         DCL (ADDR, VERIFY, DATETIME) BUILTIN;         
5  1         A = ADDR(B);                         
6  1         DCL WRKAREA CHAR(48) BASED(A);             
7  1         DCL ABC CHAR(48);                         
8  1         ABC = WRKAREA;                           
9  1          DCL 1 DATRET DEF ABC,                   
                   2 DANUM FIXED BIN(31,0) UNALIGNED,   
                   2 WKDANUM PIC '9',             
                   2 DANAME CHAR(9),               
                   2 MONAME CHAR(9),             
                                                 
                   2 MO PIC '99',                 
                   2 DA PIC '99',                 
                   2 YR PIC '9999',               
                   2 DAYR PIC '999',             
                                                   
                   2 HOURS PIC '99',             
                    .   
                    .
                    .
                   2 REQUEST CHAR(1);
 



The below uses Union:

Code:

         DCL B FIXED(1);               
         DCL A PTR;                                 
         DCL (ADDR, VERIFY, DATETIME) BUILTIN;         
         A = ADDR(B);                         
         DCL WRKAREA CHAR(48) BASED(A);             
         DCL  1 * UNION,                       
                    2 ABC CHAR(48),     
                    2 DATRET,
                     3 DANUM FIXED BIN(31,0) UNALIGNED,   
                     3 WKDANUM PIC '9',             
                     3 DANAME CHAR(9),               
                     3 MONAME CHAR(9),             
                                                 
                     3 MO PIC '99',                 
                     3 DA PIC '99',                 
                     3 YR PIC '9999',               
                     3 DAYR PIC '999',             
                                                   
                     3 HOURS PIC '99',             
              .   
              .
                   .
                    3 REQUEST CHAR(1);
 

        ABC = WRKAREA; 



I hope now there should not be any problem.

Thanks
Ajay
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 -> PL/I & Assembler

 


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 Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts file manager is doing string conversion IBM Tools 3
No new posts Search string in job at regular Spool... CLIST & REXX 0
Search our Forums:

Back to Top