CL programming Questions


CL Program
How to create ‘n’ number of userprofile from CL Program.

Answer Question   |  September 28, 2009  12:25 PM
CL, CL programming, CL programs
asked by:
75 pts.

Can i declare a display file and a physical file in a single CL
Can i declare a display file and a physical file in a single CL.  Also can u share a sample program, which uses the parameters entered in the display file (using SNDRCV command) and processes records from a physical file.

Answer Question   |  September 10, 2009  12:11 PM
AS/400 Display File, CL, CL programming, Physical Files
asked by:
1,160 pts.

Displaying data through DSPF and CL programm.!
I would like to be able to display one record from my PF with DSP file through a CL program on my screen. I have these sources: CL program: ******************************************** QSYSPRT          1  QPADEV0021  USERNAME      pgm              DCLF       FILE(MyLib/SPOOLTMP) RCDFMT(S) +                                  OPNID(DSP)                                                                                                           DCLF       FILE(Mylib/SPOOLTEMP) RCDFMT(SPOOLTEMP) +                           OPNID(PF)                                                                                                            RCVF       DEV(*FILE) RCDFMT(SPOOLTEMP) [...]

Answer Question   |  October 11, 2009  2:07 PM
CL, CL programming, CL programs, DSPF, PF
asked by:
80 pts.

Jobs goes into Message Wait after reaching End Of File.
I am using the below programs to Delete Temporary Files from Specific Libraries on monthly basis after taking a Entire System Backup. [strong]The File and Library Names are stored in a Output File called MNTHDELE in QGPL and the Column Names are &ODLBNM for File Name and &ODOBNM for Library Name[/strong]. It is observed that [...]

Answer Question   |  August 18, 2009  10:11 AM
CL programming, V5R4
asked by:
215 pts.

Controlling JDE app outage times during CL reorg
We currently run a weekly reorg controlled by a CL program. Until recently we had a four hour window and are now looking to do the reorgs with the smallest possible JDE application outage. Any recommendations?

Answer Question   |  August 2, 2009  9:01 PM
AS/400 backup, CL Program, CL programming, JDE application outage
485 pts.

SAVOBJ
I am trying to use the SAVOBJ command to copy files to a save file. Is there a way to add to the save file and not write over it with each SAVOBJ call? I know I can create a list of files and send all of them to one save file but I would [...]

Answer Question   |  October 23, 2009  7:33 PM
CL, CL Commands, CL programming, SAVOBJ
asked by:
5 pts.

Parameter list is not refreshed from previous calls
I created a command with validity checker defined. The validation work fine but the parameter list is not refreshed from previous calls to the command. I’ve defined a simple list for “user name ” parameter in my command. If I give 3 user names (A, B, & C) in the list, in the next call [...]

Answer Question   |  October 22, 2009  6:02 PM
AS/400, CL programming, Command Source, COMMANDS, CPP, iSeries, Parameter list -AS400, Validation
asked by:
15 pts.

How to read a text file to use for variables in CL
I have a CL that saves libraries as savf files to later FTP to a storage device. For each library I have a set of commands that specifiy the specific library and the specific savf file for that library. The commands are repeated three times, once for each library/savf file. I would like to have [...]

Answer Question   |  May 31, 2011  3:22 PM
CL programming, CL variables
asked by:
5 pts.

how can we use more than 1 file in CL ?
Multiple files to used in CL

Answer Question   |  April 17, 2009  1:41 PM
CL, CL programming
asked by:
90 pts.

List of Outfiles
I’ve seen a list of the System Supplied Outfiles in one of the manuals. Can anyone direct me to that manual ? Thanks, Bill Poulin

Answer Question   |  October 22, 2009  3:17 PM
AS/400 administration, AS/400 development, CL programming, CL/400, iSeries
asked by:
2,480 pts.

Delete old spool files
The following question was recently submitted by a user via e-mail: I am trying to create a program in CL to delete old spool files on the AS400. I am using the following code, but my program does not recognize any of the commands. Does anyone have any suggestions or solutions? Thank you very much. [...]

Answer Question   |  March 27, 2009  1:37 PM
CL, CL programming, Spool files
asked by:
4,265 pts.

How to extract data to the various excel sheets in a CL.
Hi, I am new to the CL (Command Language) used by the as/400. I need to generate a spreadsheet of data from the as400. I would like to have all the data stored in one excel file instead of multiple excel files. Can someone show me how to use the various sheets in excel to [...]

Answer Question   |  March 13, 2009  8:14 PM
CL programming, Microsoft Excel
asked by:
5 pts.

Override to a Logical File
hi, I am trying to create an override to a logical file. I have a PF File A which has a logical AL1. My CL program can run in a build/copy mode where Build would just build the work file and copy would build & copy the workfile etc. The CL has an override to [...]

Answer Question   |  February 25, 2009  4:55 PM
CL programming, Logical File, PF
asked by:
35 pts.

QMQRY not a valid Query Management variable.
Hi there, I am trying to pass parameters to QMQRY but get the following error. CALL PGM(JCCSTREP2) PARM(C165) ‘C165′ is not a valid Query Management variable. Error found on STRQMQRY command. CPF0001 received by JCCSTREP2 at 2800. (C D I R) the CL pgm that call the query is as follows: PGM PARM(&JOBX) DCL VAR(&JOBX) [...]

Answer Question   |  February 23, 2009  7:12 AM
CL, CL programming, CL variables, QMQRY, STRQMQRY, Variables
asked by:
25 pts.

MONITOR FOR HELD LOCKS
I created this pgm to check if a file is being locked. I would like to trap if there is a hold lock. If I can I would like to loop back if there is a hold until the hold is released. WRKOBJLCK OBJ(MCPARMS) OBJTYPE(*FILE) MONMSG MSGID(CPF9898) EXEC(PARMLCK: SNDUSRMSG + MSG(‘File MCPARMS in Library IBCFLPROD [...]

Answer Question   |  February 20, 2009  4:40 PM
CL Program, CL programming, Hold Locks, WRKOBJLCK
asked by:
25 pts.

Inside a running CL program can you find the lib that the program is running from?
Can you find in a running CL program the lib that it was started from? For example in a C program you can get the library name from argv[0].

Answer Question   |  February 18, 2009  2:46 PM
AS/400, CL Library, CL programming, CL/400
asked by:
50 pts.

clearing multple members in a physical file
Does anyone know of a way (or utility) to clear multiple members in a physical file ? i create multiple members for the file on the fly based upon date/time in a cl program. the file is a weekly archive of data from a transaction processor, and i want to clear it and start over [...]

Answer Question   |  February 14, 2009  8:17 PM
CL, CL programming, CLRPFM, Physical File
asked by:
100 pts.

ovrdbf doesn’t get deleted with a dltovr
I’ve got a cl that copies a PF file to qtemp then I use CRTDUPOBJ to get a LF attached to the qtemp PF file. Then ovrdbf of LF to qtemp/LF with OVRSCOPE(*JOB). After calling 2 programs to update the qtemp/LF I DLTOVR FILE(*ALL) LVL(*JOB). But the override stays doesn’t get deleted. I can’t figure [...]

Answer Question   |  January 27, 2009  7:21 PM
CL programming, CRTDUPOBJ, DLTOVR, OVRDBF, OVRSCOPE, PF
asked by:
45 pts.

Maximum number of CL variables with IBM i 6.1
What is the maximum number of variables that you may define using the DCL command in a CL program on an IBM i version 6.1 system? Also: Where is this documented, if you know? I couldn’t find it in the online help, Information Center, or CL Programming PDF. Thanks!

Answer Question   |  April 19, 2010  10:27 PM
AS/400, CL, CL programming, CL variables, DCL command, Declare CL Variable, IBM i, IBM i 6.1, iSeries, OS/400, System i
asked by:
10 pts.

CL problem with purge
The below code was written to automatically purge files once in 2 months.The problem here is that there are months with 30,31 and 28 days so while deletion some files may be left out.Can this be rectified. CHGVAR VAR(&PYD) VALUE(&PYC) CHGVAR VAR(&PMD) VALUE(&PMC) CHGVAR VAR(&PDD) VALUE(&PDC) CHGVAR VAR(&PMD) VALUE(&PMD-2) IF COND(&PMD *LT 1) THEN(DO) CHGVAR [...]

Answer Question   |  January 12, 2009  3:15 PM
CL, CL programming
asked by:
0 pts.