RE: SBMJOB converts command parameter to HEX

Eric Wolf <[email protected]>
Newsgroups gmane.comp.lang.as400.rpg
Message-ID <[email protected]>
All,
I want to thank everyone for looking at my unusual programming issue.  Being the dinosaur that I am (started in 1983), I tried to first use the API to convert the Hex-to-Char and was not successful.

I then tried a simple approach - if the first characters of this command parameter are X', substring the value starting with the 3rd character.  Low and behold...it worked.

Might not be the best solution...

Have a Happy Thanksgiving...

-----Original Message-----
From: RPG400-L <rpg400-l-bounces-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org> On Behalf Of Peter Dow
Sent: Wednesday, November 26, 2025 10:01 AM
To: [email protected]
Subject: Re: SBMJOB converts command parameter to HEX

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


How are you populating xmKEYFLDSPart? What is its value just before using it to build the command? -- *Peter Dow* /
909 793-9050
[email protected]
/
On 11/26/2025 9:53 AM, Eric Wolf wrote:
> Same result when I remove the %CHAR...Could it be the parameters that I use when I compile the program?
>
>                      Create SQL ILE RPG Object (CRTSQLRPGI)
>
> Type choices, press Enter.
>
> Print file . . . . . . . . . . . PRTFILE        QSYSPRT
>    Library  . . . . . . . . . . .                  *LIBL
> Debugging view . . . . . . . . . DBGVIEW      > *SOURCE
> Debug encryption key . . . . . . DBGENCKEY      *NONE
> User profile . . . . . . . . . . USRPRF       > *OWNER
> Dynamic user profile . . . . . . DYNUSRPRF    > *OWNER
> Sort sequence  . . . . . . . . . SRTSEQ       > *LANGIDSHR
>    Library  . . . . . . . . . . .
> Language id  . . . . . . . . . . LANGID         *JOB
> Conversion CCSID . . . . . . . . CVTCCSID       *NONE
> To source file . . . . . . . . . TOSRCFILE      *CALC
>    Library  . . . . . . . . . . .                  QTEMP
>
>
> -----Original Message-----
> From: RPG400-L<rpg400-l-bounces-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org> On Behalf Of Maria
> Lucia Stoppa
> Sent: Wednesday, November 26, 2025 9:29 AM
> To: RPG programming on IBM i<[email protected]>
> Subject: Re: SBMJOB converts command parameter to HEX
>
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
>
> Could you please post the result without the %char BIF?
> Also, are QCMD and the string variable defined with different CCSID?
>
> I used the same technique many times without any problem.
>
> Il giorno mer 26 nov 2025 alle ore 18:18 Eric
> Wolf<[email protected]> ha
> scritto:
>
>> I added the %CHAR in an attempt to try to resolve this issue.  I was
>> trying everything that I could think of to get this to work...
>>
>> -----Original Message-----
>> From: RPG400-L<rpg400-l-bounces-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org> On Behalf Of
>> Maria Lucia Stoppa
>> Sent: Wednesday, November 26, 2025 9:15 AM
>> To: RPG programming on IBM i<[email protected]>
>> Subject: Re: SBMJOB converts command parameter to HEX
>>
>> CAUTION: This email originated from outside of the organization. Do
>> not click links or open attachments unless you recognize the sender
>> and know the content is safe.
>>
>>
>> Hi,
>>
>> The variable xmKEYFLDSPart looks like a character string, why do you
>> need to use %char when creating the command to be executed?
>> I would have just concatenated cApos plus the trimmed variable.
>> Am I missing something?
>>
>> Lucia
>>
>> Il giorno mer 26 nov 2025 alle ore 18:08 Eric Wolf
>> <[email protected]> ha
>> scritto:
>>
>>> All,
>>> When using a custom command interactively, the command looks like this:
>>> ISIPMXPCMD TRID(PRCCHG)
>>>             DTFR(1251125)
>>>             TMFR(111404)
>>>             DTTO(1251125)
>>>             TMTO(111424)
>>>             USER(E05451)
>>>             KFLD('100,6514981001,,1140708100311F6000457F0892221F')
>>>             RPRC('0')
>>>
>>> I am building the above command using this:
>>> qcmd = 'SBMJOB CMD(ISIPMXPCMD OBCL(ITMPRC) '+
>>>         'TRID(' +%TRIM(mTRID)+ ') ' +
>>>         'DTFR(' +%EDITC(xmTRDT:'X') +') ' +
>>>         'TMFR(' +%EDITC(xmTRTMFr:'X') +') ' +
>>>         'DTTO(' +%EDITC(xmTRDT:'X') +') ' +
>>>         'TMTO(' +%EDITC(xmTRTMTo:'X') +') ' +
>>>         'USER(' +%TRIM(xmUSER) +') ' +
>>>         'KFLD('+cApost+%CHAR(%TRIM(xmKEYFLDSPart))+cApost+') ' +
>>>         'RPRC(' +cApost+'0'+cApost+')) ' +
>>>         'JOB(ITMPRCCHG)  ' +
>>>         'JOBQ(QBATCHB)';
>>>
>>>
>>>
>>> When using the SBMJOB, the command converts the KFLD parameter to this:
>>> ISIPMXPCMD OBCL(ITMPRC) TRID(PRCCHG) DTFR(1251125) TMFR(163403)
>>> DTTO(12511
>>> 25) TMTO(163423) USER(E05451)
>>> KFLD(X'F1F0F06BF6F5F1F4F9F8F1F0F0F76B6B11407
>>> 08103251F7000602F0892221F') RPRC('0')
>>>
>>> What feature of the SBMJOB command or the command itself do I need
>>> to change to get the SBMJOB command to look like the interactive version?
>>>
>>> TIA,
>>> Eric
>>> This communication is intended only for the use of the individual or
>>> entity to which it is addressed and may contain information that is
>>> privileged, confidential, or otherwise exempt from disclosure under
>>> applicable law. If you are not the intended recipient, or the
>>> employee or agent responsible for delivering this communication to
>>> the intended recipient, you are hereby notified that any
>>> dissemination, distribution, or copying of this communication is strictly prohibited.
>>> If you have received this communication in error, please immediately
>>> notify the sender by telephone or email. The technical data herein
>>> provided is subject to export control under the International
>>> Traffic in Arms Regulations (ITAR) or the Export Administration
>>> Regulations (EAR). Such data should not be disclosed, exported or
>>> transferred in any manner to any foreign person or any foreign
>>> country without prior written approval of the Office of Defense Trade Controls, U.S.
>> Department of State or the Bureau of Industry
>>>    and Security, U.S. Department of Commerce. This email and any
>>> attachments may contain confidential and proprietary information and
>>> must be treated as such. In addition, the export or re-export of
>>> this information may be prohibited under applicable export control laws.
>>> --
>>> This is the RPG programming on IBM i (RPG400-L) mailing list To post
>>> a message email:[email protected] To subscribe,
>>> unsubscribe, or change list options,
>>> visit:
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.
>>> co
>>> m_mailman_listinfo_rpg400-2Dl&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf
>>> -v
>>> 5A_CdpgnVfiiMM&r=PCeNSf9fhcAUxJzoAZa9Db8EQ_28MTQACuQxevMqYzc&m=BEdqK
>>> uD
>>> iFcZh6CKvp31ZsKN7Ptnwm-tmiBfvBinWfwC37EDgAvtmg2e4V_X7q6V4&s=ZjJryfNu
>>> n1 H9k2rmqnqdf7r5QG946A6f5fAimH8egxw&e=
>>> or email:RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
>>> Before posting, please take a moment to review the archives at
>>>
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.
>> com_rpg400-2Dl&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM
>> &
>> r=PCeNSf9fhcAUxJzoAZa9Db8EQ_28MTQACuQxevMqYzc&m=BEdqKuDiFcZh6CKvp31Zs
>> K
>> N7Ptnwm-tmiBfvBinWfwC37EDgAvtmg2e4V_X7q6V4&s=BOcBzbgo7BApID2hAVaXI349
>> V
>> aS8whoUgcahyrdTeYw&e=
>> .
>>> Please contactsupport-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription
>>> related questions.
>>>
>>>
>> --
>>
>> Maria Lucia Stoppa
>> [email protected]
>> --
>> This is the RPG programming on IBM i (RPG400-L) mailing list To post
>> a message email:[email protected] To subscribe,
>> unsubscribe, or change list options,
>> visit:
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.c
>> o
>> m_mailman_listinfo_rpg400-2Dl&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-
>> v
>> 5A_CdpgnVfiiMM&r=PCeNSf9fhcAUxJzoAZa9Db8EQ_28MTQACuQxevMqYzc&m=BEdqKu
>> D
>> iFcZh6CKvp31ZsKN7Ptnwm-tmiBfvBinWfwC37EDgAvtmg2e4V_X7q6V4&s=ZjJryfNun
>> 1
>> H9k2rmqnqdf7r5QG946A6f5fAimH8egxw&e=
>> or email:RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
>> Before posting, please take a moment to review the archives at
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.
>> com_rpg400-2Dl&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM
>> &
>> r=PCeNSf9fhcAUxJzoAZa9Db8EQ_28MTQACuQxevMqYzc&m=BEdqKuDiFcZh6CKvp31Zs
>> K
>> N7Ptnwm-tmiBfvBinWfwC37EDgAvtmg2e4V_X7q6V4&s=BOcBzbgo7BApID2hAVaXI349
>> V
>> aS8whoUgcahyrdTeYw&e=
>> .
>>
>> Please contactsupport-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription
>> related questions.
>>
>>
>> This communication is intended only for the use of the individual or
>> entity to which it is addressed and may contain information that is
>> privileged, confidential, or otherwise exempt from disclosure under
>> applicable law. If you are not the intended recipient, or the
>> employee or agent responsible for delivering this communication to
>> the intended recipient, you are hereby notified that any
>> dissemination, distribution, or copying of this communication is strictly prohibited.
>> If you have received this communication in error, please immediately
>> notify the sender by telephone or email. The technical data herein
>> provided is subject to export control under the International Traffic
>> in Arms Regulations (ITAR) or the Export Administration Regulations
>> (EAR). Such data should not be disclosed, exported or transferred in
>> any manner to any foreign person or any foreign country without prior
>> written approval of the Office of Defense Trade Controls, U.S. Department of State or the Bureau of Industry
>>    and Security, U.S. Department of Commerce. This email and any
>> attachments may contain confidential and proprietary information and
>> must be treated as such. In addition, the export or re-export of this
>> information may be prohibited under applicable export control laws.
>> --
>> This is the RPG programming on IBM i (RPG400-L) mailing list To post
>> a message email:[email protected] To subscribe,
>> unsubscribe, or change list options,
>> visit:
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.c
>> o
>> m_mailman_listinfo_rpg400-2Dl&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-
>> v
>> 5A_CdpgnVfiiMM&r=PCeNSf9fhcAUxJzoAZa9Db8EQ_28MTQACuQxevMqYzc&m=_kLwKQ
>> 7
>> 490XVwgTpJcYjH2UJjGxyviso0G57g-wgguH1wS7wwdT2zu-uAnqgaQvP&s=RnMA7zAXv
>> 8
>> rvOVuSDB1ntBjQwp7tqv1o_lxtSne4ZXs&e=
>> or email:RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
>> Before posting, please take a moment to review the archives at
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_rpg400-2Dl&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=PCeNSf9fhcAUxJzoAZa9Db8EQ_28MTQACuQxevMqYzc&m=_kLwKQ7490XVwgTpJcYjH2UJjGxyviso0G57g-wgguH1wS7wwdT2zu-uAnqgaQvP&s=r7CeneroV1AUxsTBd1vQotzAg3-8ylz8u41v4gl1zFo&e=.
>>
>> Please contactsupport-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription
>> related questions.
>>
>>
> --
>
> Maria Lucia Stoppa
> [email protected]
> --
> This is the RPG programming on IBM i (RPG400-L) mailing list To post a
> message email:[email protected] To subscribe, unsubscribe,
> or change list options,
> visit:https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midra
> nge.com_mailman_listinfo_rpg400-2Dl&d=DwICAg&c=euGZstcaTDllvimEN8b7jXr
> wqOf-v5A_CdpgnVfiiMM&r=PCeNSf9fhcAUxJzoAZa9Db8EQ_28MTQACuQxevMqYzc&m=_
> kLwKQ7490XVwgTpJcYjH2UJjGxyviso0G57g-wgguH1wS7wwdT2zu-uAnqgaQvP&s=RnMA
> 7zAXv8rvOVuSDB1ntBjQwp7tqv1o_lxtSne4ZXs&e=
> or email:RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
> Before posting, please take a moment to review the archives athttps://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_rpg400-2Dl&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=PCeNSf9fhcAUxJzoAZa9Db8EQ_28MTQACuQxevMqYzc&m=_kLwKQ7490XVwgTpJcYjH2UJjGxyviso0G57g-wgguH1wS7wwdT2zu-uAnqgaQvP&s=r7CeneroV1AUxsTBd1vQotzAg3-8ylz8u41v4gl1zFo&e=.
>
> Please contactsupport-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.
>
>
> This communication is intended only for the use of the individual or
> entity to which it is addressed and may contain information that is
> privileged, confidential, or otherwise exempt from disclosure under
> applicable law. If you are not the intended recipient, or the employee
> or agent responsible for delivering this communication to the intended
> recipient, you are hereby notified that any dissemination,
> distribution, or copying of this communication is strictly prohibited.
> If you have received this communication in error, please immediately
> notify the sender by telephone or email. The technical data herein
> provided is subject to export control under the International Traffic
> in Arms Regulations (ITAR) or the Export Administration Regulations
> (EAR). Such data should not be disclosed, exported or transferred in
> any manner to any foreign person or any foreign country without prior
> written approval of the Office of Defense Trade Controls, U.S.
> Department of State or the Bureau of Indust
 ry
>    and Security, U.S. Department of Commerce. This email and any attachments may contain confidential and proprietary information and must be treated as such. In addition, the export or re-export of this information may be prohibited under applicable export control laws.

--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options,
visit: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_rpg400-2Dl&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=PCeNSf9fhcAUxJzoAZa9Db8EQ_28MTQACuQxevMqYzc&m=a2t1SvtWTWAs9RogP8evnYIprhQYmc_HGmF1ZB66QuYNT2bKy87WWuz-N0cqArDI&s=TzzaXua6DZpBHabiSqPdrhf3Y1oYDjIHSE62rbe35YM&e=
or email: RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives at https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_rpg400-2Dl&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=PCeNSf9fhcAUxJzoAZa9Db8EQ_28MTQACuQxevMqYzc&m=a2t1SvtWTWAs9RogP8evnYIprhQYmc_HGmF1ZB66QuYNT2bKy87WWuz-N0cqArDI&s=QhB8uAWRAcelUEAoQ2tTlKuzlNFgIve5gy9ET0IIOrU&e=.

Please contact support-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.


This communication is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential, or otherwise exempt from disclosure under applicable law. If you are not the intended recipient, or the employee or agent responsible for delivering this communication to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender by telephone or email. The technical data herein provided is subject to export control under the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). Such data should not be disclosed, exporte
 d or transferred in any manner to any foreign person or any foreign country without prior written approval of the Office of Defense Trade Controls, U.S. Department of State or the Bureau of Industry
  and Security, U.S. Department of Commerce. This email and any attachments may contain confidential and proprietary information and must be treated as such. In addition, the export or re-export of this information may be prohibited under applicable export control laws.
-- 
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.