Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Usage of Like statement in PL/I

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Sakthidevi

New User


Joined: 15 Nov 2019
Posts: 5
Location: India

PostPosted: Fri Nov 15, 2019 11:22 pm    Post subject: Usage of Like statement in PL/I
Reply with quote

Hi,

Is the below syntax valid in PL/I?

DCL A CHAR(10),
B LIKE A,
C LIKE B,
D LIKE C;

This was asked as an interview question.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8505
Location: Dubuque, Iowa, USA

PostPosted: Sat Nov 16, 2019 1:17 am    Post subject: Reply to: Usage of Like statement in PL/I
Reply with quote

The PL/I Language Reference manual has this example:
Quote:
The following declarations are valid, but only because B is declared before C and E is declared before F:
dcl 1 a, 2 a1 fixed bin;
dcl 1 b, 2 b1 like a;
dcl 1 c, 2 c1 like b;
dcl 1 d, 2 d1 fixed bin;
dcl 1 e like d;
So it appears the interview question's declarations are valid, but I don't have access to a PL/I compiler to verify that.
Back to top
View user's profile Send private message
prino

Senior Member


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

PostPosted: Sat Nov 16, 2019 2:30 am    Post subject:
Reply with quote

Why didn't you look it up in the manual, after the interview?

It may be allowed nowadays, but it wasn't in earlier versions of PL/I (including Enterprise PL/I), and I have my doubts about using like for elementary variables.

And you're a housewife?
Back to top
View user's profile Send private message
Sakthidevi

New User


Joined: 15 Nov 2019
Posts: 5
Location: India

PostPosted: Sat Nov 16, 2019 11:55 am    Post subject: Reply to: Usage of Like statement in PL/I
Reply with quote

Thanks Robert!

I have 13 years of experience in mainframe and currently looking for a change.

Never have seen such a logic. Do people do something as bad as that?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Usage of pre-processor statement in p... Sakthidevi PL/I & Assembler 1 Thu Nov 28, 2019 4:08 pm
No new posts Usage of external condition Sakthidevi PL/I & Assembler 1 Sat Nov 23, 2019 1:46 pm
No new posts COBOL -DB2 SQL code to have GROUP BY ... vinu78 DB2 21 Wed Oct 23, 2019 7:00 pm
No new posts FORMATTIME - CPU usage Nileshkul CICS 4 Sun Aug 18, 2019 5:22 am
No new posts ALTERNATE RECORD KEY usage for KSDS AIX sophia.lee COBOL Programming 1 Thu Jul 25, 2019 7:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us