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: 2216
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: 2216
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: 870
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 Control M features to check string in... Compuware & Other Tools 0
No new posts CONTROL-M SCHEDULING DEFINITION FACILITY Compuware & Other Tools 1
This topic is locked: you cannot edit posts or make replies. Assembler - Packed Decimals - PACK in... PL/I & Assembler 3
No new posts Calling Assembler from REXX PL/I & Assembler 5
No new posts SYNCSORT Error - CONTROL FIELD BEYOND... SYNCSORT 10
Search our Forums:

Back to Top