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

mapping PLI structure to assembler control block


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

Global Moderator


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

PostPosted: Fri Jun 01, 2018 2:53 am
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

Global Moderator


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

PostPosted: Fri Jun 01, 2018 3:50 am
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: 917
Location: The Universe

PostPosted: Fri Jun 01, 2018 8:32 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts Build dataset list with properties us... PL/I & Assembler 4
No new posts Finding Assembler programs PL/I & Assembler 5
No new posts How Can I Recall a Migrated Data Set ... PL/I & Assembler 3
No new posts step by step trace 4 ISPF dialog call... TSO/ISPF 17
Search our Forums:

Back to Top