Midrange News for the IBM i Community


Posted by: renojim
CL
has no ratings.
Published: 25 Sep 2017
Revised: 26 Sep 2017 - 2402 days ago
Last viewed on: 23 Apr 2024 (2284 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

COMMENTS

(Sign in to Post a Comment)
Posted by: DaleB
Premium member *
Reading, PA
Comment on: CL
Posted: 6 years 6 months 30 days 26 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: 6 years 6 months 29 days 23 hours 59 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)

RTVJOBA TYPE(&TYPE) SUBTYPE(&SUBTYPE) 

If ( &TYPE *NE '0' *OR &SUBTYPE *NE 'J') THEN(RETURN) 

Ringer 

Posted by: renojim
Premium member *
Comment on: CL
Posted: 6 years 6 months 29 days 18 hours 54 minutes ago

Great stuff! Thanks!