How to write a CL program if SQL query is giving some record

1485 pts.
Tags:
CL programs
SQL Query
Hi, How can a CL program can be written based on some SQL query which gives some records. If SQL query is giving some records as output then using SNDEMLMSG command, how can that CL program be written? SNDEMLMSG command will send an email to specific user based on SQL query's output if any thing comes in output for that SQL query. Then the SNDEMLMSG command will be triggered and it will send an email to intended user. How to write that IF condition for above requirement? Any approach for that logic will be much helpful. Thanks

Software/Hardware used:
AS/400,CL/400

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • CharlieBrowne
    I am not sure I understand the question, but I know your SNDEMLMSG command is not an IBM supplied command. It is homegrown.You may need to look at or modify the source for this command.
    41,370 pointsBadges:
    report
  • TomLiotta
    CL isn't enabled for embedded SQL. Use a language that supports embedded SQL.   However, CL can run some SQL statements with RUNSQLSTM, STRQMQRY or RUNSQL. (RUNSQL can be added via PTFs for 6.1 and 7.1.) If you run a SQL INSERT statement, you can insert a record from a query into a file. Then you can use RCVF in CL to read that record.   Or you can use OPNQRYF instead of SQL. Then CL can use RCVF to read records from the query file.   There are other methods that get more complicated to write or that use downloaded functions such as Bruce Vining's programming.   Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following