[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

sql command to call a cl program

Posted on 2006-11-06
12
Medium Priority
?
1,169 Views
Last Modified: 2010-07-27
i know that its possible to call some programs from the as400 through a sql query, but can i access a cl program through a sql command?  we have used trigger files on the 400 previously to fire off programs, but it would be nice to just hit the program myself instead of messing with a trigger.
0
Comment
Question by:WMIF
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
12 Comments
 
LVL 18

Expert Comment

by:Dave Ford
ID: 17885806
Preface the command with "CL: "

e.g.
CL: DSPJRN JRN(MyLib/QSQJRN) OUTPUT(*OUTFILE) OUTFILFMT(*TYPE4) OUTFILE(qtemp/dspjrn);

HTH,
DaveSlash
0
 
LVL 22

Author Comment

by:WMIF
ID: 17885828
just to be clear (because i am definately not a 400 person).  you have the name of the program, then several parameters that are specific to that program?  so if a cl program didnt take any parameters is would like like this?

CL: DSPJRN ;
0
 
LVL 27

Assisted Solution

by:tliotta
tliotta earned 400 total points
ID: 17885901
WMIF:

A CL program would be called through use of the SQL CALL statement just like any other program called with SQL.

As long as parameter values are not required to transmit from the system back to the client, the target program does not need to be registered as a stored procedure.

Tom
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
LVL 27

Expert Comment

by:tliotta
ID: 18064343
No objection as far as points go, but the OP should clarify whether the need is to execute a CL command or call a program (a CL program or otherwise).

Tom
0
 
LVL 27

Expert Comment

by:tliotta
ID: 18066693
Understood, that's why no objection on points. I'm just being an idealist. Questions can get closed without clear resolution at times, and I'd like future readers to benefit where possible.

Ideals can be difficult.

Tom
0
 
LVL 22

Author Comment

by:WMIF
ID: 18070484
sorry about this guys.  my intention was to get with the as400 programmer to do some testing, but he got busy with other projects and then i forgot.


>the OP should clarify whether the need is to execute a CL command or call a program (a CL program or otherwise)

im not sure that i understand the difference in the question.  maybe a command is referring to a built in program verses a custom written program?
0
 
LVL 18

Accepted Solution

by:
Dave Ford earned 800 total points
ID: 18070906
Sorry, I should have been more detailed.

If you're going to call a CL program within SQL, you'd simply put the CALL in the string.

e.g.
CL: call MyPgm PARM('parameter1' 'paramter2' 'parameter3');

HTH,
DaveSlash
0
 
LVL 18

Expert Comment

by:Dave Ford
ID: 18070917
Alternately, you could wrap your CL program as a stored procedure with the CREATE PROCEDUE statement. Then, from within SQL, you could simply call your program (withot prefacing it with "CL:")

DaveSlash
0
 
LVL 22

Author Comment

by:WMIF
ID: 18071046
thanks for that clarification, and more points for letting it go stale.
0
 
LVL 27

Expert Comment

by:tliotta
ID: 18073174
I wouldn't expect that the [CL:] prefix would be used for a CALL _unless_ there was a need to execute the CL CALL command itself. This should be different from running the SQL CALL statement for stored procedures.

No?

Tom
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working from home is a dream for many people who aren’t happy about getting up early, going to the office, and spending long hours at work. There are lots of benefits of remote work for employees.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question