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

Defining a struct


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

New User


Joined: 21 Sep 2022
Posts: 10
Location: USA

PostPosted: Wed Nov 30, 2022 10:50 pm
Reply with quote

It was explained to me struct are similar to classes in Java and can be created and extended to define an "object". I am reading and testing but not sure I understand how structures truly work.
Code:

  dcl 1 person,
            2 first_name    var char(50),
            2 last_name     var char(50),
            2 is_developer  var char(1);

  dcl london_emp    type person;
  dcl ny_emp        type person;
 


When I compile
Code:
ny_emp.first_name = "Joe"
, I get an error stating
Code:
the dot qualified reference ny_emp.first_name is unknown
.

Am I misunderstanding and structs cant be used this way?
Do I need to make a struct for both NY and London?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2127
Location: USA

PostPosted: Thu Dec 01, 2022 2:08 am
Reply with quote

Code:
declare 1 coBorrower like Borrower;
Back to top
View user's profile Send private message
SlippingJimmy

New User


Joined: 21 Sep 2022
Posts: 10
Location: USA

PostPosted: Thu Dec 01, 2022 4:04 am
Reply with quote

sergeyken wrote:
Code:
declare 1 coBorrower like Borrower;


I'm not sure I understand what your trying to say.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2127
Location: USA

PostPosted: Thu Dec 01, 2022 4:53 am
Reply with quote

SlippingJimmy wrote:
sergeyken wrote:
Code:
declare 1 coBorrower like Borrower;


I'm not sure I understand what your trying to say.


You have to use LIKE keyword in place of incorrect one: TYPE.
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 defining a global LUA function in Inf... IBM Tools 1
No new posts Defining SYSLIB to USS c++ (cxx) comp... All Other Mainframe Topics 2
No new posts Defining SSL Port in TCPIP for DB2 Se... TSO/ISPF 1
No new posts Defining a VSAM File as CICS Table CICS 2
No new posts defining an alias (alternate entrynam... All Other Mainframe Topics 1
Search our Forums:

Back to Top