Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
mapping PLI structure to assembler control block

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

Senior Member


Joined: 01 Sep 2006
Posts: 2113
Location: Silicon Valley

PostPosted: Fri Jun 01, 2018 2:53 am    Post subject: mapping PLI structure to assembler control block
Reply with quote

One of the fields in assembler is declared DS PL3

I want to refer to it from a PLI program. I have to create a PLI structure similar to the assembler dsect. If I declare the field as FIXED BIN(24), it uses four bytes, causing an incorrect offset for other fields.

If I declare it as CHAR(3), it preserves the correct offsets, but how to refer to the numeric data?

I tried something like this:
Code:
dcl 1 struct1,
2   char1    char(3),
3   fix1       fixed bin(24);

but the compiler says 'The attribute CHARACTER conflicts with previous attributes and is ignored'.

I also tried:
Code:
dcl  fix2 fixed bin(31);

fix2 = BINARY(char1);


but it gets ONCODE=612 conversion error occurred when converting a character string to an arithmetic value.
Back to top
View user's profile Send private message

Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2113
Location: Silicon Valley

PostPosted: Fri Jun 01, 2018 3:50 am    Post subject: Reply to: mapping PLI structure to assembler control block
Reply with quote

UNION is the key. I wound up doing this:
Code:
dcl  1 work1  UNION,
  2  txt,
      3  txt1     char(1),
      3  txt3     char(3),
  2  fix1          fixed bin(31);

txt1  =  '00'x;
txt3 =  asm3;
/* then referring to fix1 */
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 657
Location: The Universe

PostPosted: Fri Jun 01, 2018 8:32 am    Post subject:
Reply with quote

I'm not so good with PL/I data types, but wouldn't an Assembler PL3 be
Code:
dcl pl3 fixed decimal(5);
Back to top
View user's profile Send private message
Bernie Rataj

New User


Joined: 02 Jun 2018
Posts: 2
Location: Canada

PostPosted: Sat Jun 02, 2018 2:31 am    Post subject: Reply to: mapping PLI structure to assembler control block
Reply with quote

PL3 is packed decimal, length 3 (bytes).

That would correspond to fixed decimal(5), as a nibble of the 3 bytes is for the sign, and the remaining 5 nibbles for digits.
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 How to control the elapsed time for a... Philippe JCL & VSAM 12 Thu Aug 09, 2018 5:54 pm
No new posts In which program the FILE CONTROL wil... Poha Eater COBOL Programming 2 Thu Jun 28, 2018 9:02 pm
No new posts Code Coverage and static analysis too... Aditya.Srivastava PL/I & Assembler 2 Fri May 25, 2018 12:48 pm
No new posts SYSADATA - COBOL - Structure displace... ganasrinivasan COBOL Programming 3 Thu May 24, 2018 9:45 pm
No new posts Control M - Predecessor/successor of ... SRIDEVI TANTRY Compuware & Other Tools 6 Sun May 06, 2018 10:57 am

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