Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8777237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:14:00+00:00 2026-06-13T19:14:00+00:00

I have a RPG program A and a CL program B. A calls B

  • 0

I have a RPG program A and a CL program B. A calls B with a data structure as entry parameter. This data structure contains characters as well as packed decimals. The entry parameter in B is declared as a character variable, so when the entry parameter is passed in from A, the decimal values end up in their hex-decimal format. I need their original decimal values in B. Is there any way to convert these hex character strings back to decimal in B?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:14:02+00:00Added an answer on June 13, 2026 at 7:14 pm

    You don’t need to convert. Define the decimal field over the appropriate location in your data structure.

    PGM (&STRUCT)
       DCL &STRUCT      *CHAR 12
       DCL &NAME        *CHAR 10   STG(*DEFINED) DEFVAR(&STRUCT)
       DCL &NBR         *DEC (3 0) STG(*DEFINED) DEFVAR(&STRUCT 11)
    

    The *DEFINED storage method works well when the position is fixed. In a situation where the location may vary, then use *BASED storage.

    In this example there is a numeric value in a position determined by a format parameter. The value will be incremented by 1 or two.

    PGM (&STRUCT)
       DCL &STRUCT     *CHAR 80
       DCL &FMT        *CHAR 4
       DCL &P1         *PTR
       DCL &NUM        *DEC (3 0) STG(*BASED)
       ...
       CHGVAR &FMT %SUBSTR(&STRUCT 1 4)
       CHGVAR  &P1  %ADDRESS(&STRUCT)
       SELECT
          WHEN (&FMT = 'ONE ')  THEN(DO)
             CHGVAR %OFFSET(&P1) 20       /* POS 21 IN STRUCT */
             CHGVAR &NUM (&NUM + 1)       /* INCREMENT NUMBER BY 1 */
             ENDDO
          WHEN  (&FMT = 'TWO ')  THEN(DO)
             CHGVAR %OFFSET(&P1) 40       /* POS 41 IN STRUCT */
             CHGVAR &NUM (&NUM + 2)       /* INCREMENT NUMBER BY 2 */
             ENDDO
          OTHERWISE DO
             /* EXIT WITH ERROR */
             ...
             ENDDO
          ENDSELECT
    

    See Variables in CL commands

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario: old legacy code in rpg have to consume data from a new web
Ok so I have this 2D Tile RPG I am making.... here is a
Im developing a 2d RPG using surfaceview. This is how Ive done: I have
Let's have a look at this code: package rpg; interface A { // An
I have a string like this: Tickets order: № 123123123. CED-MSW-RPG-MOW-CEK PODYLOVA/ALEMR 555 423578932
From this rpg socket tutorial we created a socket client in rpg that calls
we have quite a lot of RPG-programs here, and we do a lot of
Basically, I have an RPG-type Rails application. I'm storing skills in a skills database
I trying to complete a RPG game for a project, but have no idea
have written this little class, which generates a UUID every time an object of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.