Midrange News for the IBM i Community

Posted by: renojim
has no ratings.
Published: 25 Sep 2017
Revised: 26 Sep 2017 - 1738 days ago
Last viewed on: 30 Jun 2022 (1732 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

CL Published by: renojim on 25 Sep 2017 view comments(3)

I have a requirement to create a CL program that cannot be called from the command line. It will be called from a java portlet by users that have authority, but no one can call it from a command line. I have no idea how to pull that off. Anybody?

Return to midrangenews.com home page.
Sort Ascend | Descend


(Sign in to Post a Comment)
Posted by: DaleB
Premium member *
Reading, PA
Comment on: CL
Posted: 4 years 9 months 4 days 4 hours 9 minutes ago

Don't think you can prevent the CALL, except by security. But if you had something you could test, that could tell the difference between call rom Java portlet and call from command line, you could return without doing anything. Maybe interrogate the call stack (QWVRCSTK)?

Posted by: Ringer
Premium member *
Comment on: CL
Posted: 4 years 9 months 4 days 3 hours 42 minutes ago

If called from Java client, Client Access, PHP, etc. I believe the job type will be '0' (batch) and the subjob type would be 'J' (prestart job). Add edits to the CL program and exit if not that condition. Also *PUBLIC *EXCLUDE obviously on the object authority. 

DCL        VAR(&Type      ) TYPE(*CHAR) LEN(1)

DCL        VAR(&SubType   ) TYPE(*CHAR) LEN(1)




Posted by: renojim
Premium member *
Comment on: CL
Posted: 4 years 9 months 3 days 22 hours 38 minutes ago

Great stuff! Thanks!