CL Program Questions


Help required in writing a CL program which will monitor QSYSOPR msgq for specific h/w failure msg ID’s and shoot email ?
Hi All – Could any one help me in writing a CL program which will monitor the QSYSOPR msgq for specific h/w failure MSGID’s and shoot email ? Regards, Madhu

Answer Question   |  May 6, 2013  1:04 PM
CL Program, CL/400, OS/400 and iSeries
asked by:
30 pts.

Deleting SAVED journal receivers
I want to delete journal receivers in a library that have the the status of SAVED. Can anyone offer some CL code to do this in a program? Each receiver begins with AMQA and followed by 6 numerics. I guess I would write out to an outfile then read the outfile to delete the receivers.

Answer Question   |  April 30, 2013  7:11 PM
AS/400, AS/400 journaling, CL Program
asked by:
145 pts.

AS/400
Hi, I need a CL program to display a record from a file in a loop condition. If a file exists, then it should display the records or else it should display the message file does not exists. Please help me. The program should contain dcf,monmsg,rcvf. Now I’m learning AS/400 basics.

Answer Question   |  April 28, 2013  5:15 AM
AS/400, AS/400 commands, CL Program
asked by:
10 pts.

Show error message to user after a CPYF command ended in error in CL program
I have a copy command in my CL program. I have specified tofile and tomember parameters. I have given CRTFILE(*NO) so that I don’t want to create a source file if it is not existing. I want to show a message “Sourcefile is invalid” when the source file is not an existing one. I want [...]

Answer Question   |  April 19, 2013  5:27 AM
AS/400, CL Program
asked by:
1,965 pts.

Changing user profiles in a CL program
Since I’m not much of a programmer I was wondering if someone could offer some suggestions on three programs I need to write. My first program will need to delete the JOBD associated with the user profile in QGPL and replace it with a different JOBD. The profiles that will have to be changed will [...]

Answer Question   |  April 18, 2013  7:04 PM
CL Program, JOBD, QGPL
asked by:
145 pts.

Making changes in a user profile with a CL program
I am going to need to write a CL program that will read a list downloaded from an Excel spreadsheet onto the AS/400. The CL will scan through the file that will delete the job description associated with the user profile in QGPL and will replace the deleted job description with a new JOBD that [...]

Answer Question   |  April 18, 2013  1:24 AM
AS/400, CL Program
asked by:
135 pts.

Column heading issue with RUNQRY in CL
I have a CL program which has a RUNQRY. I have two input files and I have defined the result fields. I have given an expression and I have used column heading. The issue is after executing the query, if I do a RUNQRY on the outfile, I am not able to see the column [...]

Answer Question   |  April 3, 2013  10:54 AM
AS/400, CL Program
asked by:
1,965 pts.

Execute from a source member list
I saw a colleague run something, and I know he built the user defined option (F16) “EX” in the WRKxxxPDM display, I don’t know the CMD/CL routine or Syntax for the source file/type. Thanks in advance! Dan

Answer Question   |  February 18, 2013  12:58 PM
CL Program, CMD, syntax
asked by:
15 pts.

Program is expecting a file not used in this call
I have 2 different environments using 2 different library lists. A user takes an option from a menu and a CL program is called with overrides to a database file and then an interactive RPG program is called. The user then exits this program and then goes to the other environment (different libraries) and takes [...]

Answer Question   |  February 13, 2013  3:45 PM
CL Program, CPF4101, RPG Program
asked by:
40 pts.

Determine if a submitted job has completed
Hello ALL — I have a CL program that executes a command which calls a CL utility program. The utility program submits a job that involves the building of a save file. The original CL program will then restore the contents of the save file into a library and obviously must wait until the submitted [...]

Answer Question   |  January 18, 2013  3:56 PM
CL Program, iSeries, QUSRJOBI
asked by:
75 pts.

Convert an *iso date to *longjul in CLP
I am trying to convert an *iso date to a *longjul date in a CL program so I can subtract 6 days from today. It is crashing with a message “Date contains too many or too few numeric characters.” My code is : Definitions dcl var(&julend) type(*char) len(7) dcl var(&jul) type(*dec) len(8 0) Code cvtdat [...]

Answer Question   |  January 7, 2013  11:19 PM
CL Errors, CL Program
asked by:
30 pts.

Need to email a spool file from a CL program.
We currently use TMAIL to email spool files from CL programs. I looked at SNDDST but I believe you can’t email a spool file using that command. Is there another alternative?

Answer Question   |  December 26, 2012  7:55 PM
CL Program, Spool files
asked by:
30 pts.

compiling cl program, ownership issues
i added a commment line to a current CL program. when i went to compile it thefollowing error message appeared Owner of object COPPK1 and object being replaced not the same. any ideas?

Answer Question   |  December 20, 2012  8:58 PM
CL Program, compling, i series
asked by:
10 pts.

Writing CL to run programs, need to monitor for program completion: IF/THEN?
I’m trying to write a process that will start a program, monitor it for completion and decide to either proceed to the next program if goes END OF JOB, or display a message and terminate the running CL if the program not have successful END OF JOB. I have written a CL that will run [...]

Answer Question   |  December 7, 2012  5:34 AM
CL Program, iSeries, Premier
asked by:
50 pts.

Need to Identify whether a program is using by any user
I need to create a program which need to verify whether a specific program is using by any other user in the environment, before allowing the user to use the program. Is there any way we can identify in CL or RPG that a program is using by how many users at a specified time?

Answer Question   |  November 27, 2012  2:03 AM
CL Program, RPG Program
asked by:
195 pts.

Update a file from CL program
Why it is said we cannot update a file through CL? We can use RunsqlStm or Runqry to update a record right? If I select a particular record by using Rcvf or opnqryf and then perform runqry/runsqlstm, will it pick the desired record?

Answer Question   |  November 26, 2012  6:45 AM
AS/400, CL Program
asked by:
1,965 pts.

How to give If condition in CL/400 program
Hi, I want to give two If conditions in a cl program to make sure the value of field is between the Range. I am trying to write following line of code but syntax error is coming,any idea/suggestions How can I do comparison at a same time: IF COND(%SST(&ODOBNM 7 4) *LE %SST(&VAR1 7 4)) [...]

Answer Question   |  November 26, 2012  12:14 PM
AS/400, CL Program
asked by:
6r
940 pts.

STRPCCMD
have a STRPCCMD command in my CL program to open an IFS folder which has the .CSV files. STRPCCMD PAUSE(*NO) PCCMD(””start ” ” “\’+%trim(P@SYSNAME)+%xlate(‘/’:'’:DFTPATH)+’””)’ P@Sysname has the system name. I can see a popup DOS window but getting message the path not found. I am able to see the path and the .CSV files through [...]

Answer Question   |  October 17, 2012  6:51 AM
.CSV files, CL Program, STRPCCMD
asked by:
1,965 pts.

Recompile CL program
Hi, We added few new fields to an exising Physical file. When I check for the dependents for the changed Physical file in ALDON it shows 250 dependent objects. Do I need to recompile all 250 objects? Thanks, Elan

Answer Question   |  June 6, 2012  1:18 PM
AS/400, CL Program
asked by:
0 pts.

Overlay Printing Issue
I have one overlay that two programs use. When testing I have a very simple CL program with one OVRDBF and two program calls one of which I have commented out because I swithch calls when testing. In trying to print a voucher the main voucher program works fine, I then modify the CL by [...]

Answer Question   |  March 22, 2012  3:40 PM
CL Program, iSeries Overlay Printing Issue
asked by:
30 pts.