Portal | 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
 
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

Global Moderator


Joined: 01 Sep 2006
Posts: 2205
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

Global Moderator


Joined: 01 Sep 2006
Posts: 2205
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: 859
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
This topic is locked: you cannot edit posts or make replies. Control-M Information. Vineet CLIST & REXX 1 Mon Sep 21, 2020 6:32 pm
No new posts Learning about Systems Assembler prog... WilliamDownie PL/I & Assembler 5 Mon Jul 20, 2020 3:27 pm
No new posts TSO and the STAX Assembler Macro mxgdontmics PL/I & Assembler 43 Mon Jun 15, 2020 10:33 am
No new posts Mainframe ASSEMBLER LEARNING MANUAL w... upendrasri PL/I & Assembler 2 Tue May 05, 2020 11:42 am
No new posts LA instruction in assembler janishyathi bonam PL/I & Assembler 4 Tue May 05, 2020 8:17 am

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