COBOL Questions


Sort a table in COBOL on the Output Side
Warning: I have limited knowledge of tables!  I have a COBOL program that calculates GPAs on the fly in the OUTPUT section of the program.  I have to store these on-the-fly GPAs in a table, and then sort them by school, grade level, GPA total, then student id.  I can load my table, but I am not sorting [...]

Answer Question   |  March 2, 2011  9:38 PM
COBOL, COBOL Programs, ILE COBOL, iSeries Cobol programming
asked by:
110 pts.

Problems with DB2 program
I have a COBOL program that calls a db2 stored proc program. I get corrupted o/p records when reading the input file from CARTRIDGE. The same records, when copied to DASD, come out fine. Same code, JCL, etc. WTH! Is there a parameter that I need to pass to the system with PGM=IKJEFT01 to solve [...]

Answer Question   |  January 26, 2011  3:49 AM
AS/400 Parameters, COBOL, DB2, DB2 administration
asked by:
5 pts.

Move to One Update Program in Cobol
Been running some test, to try to use one update program to help with recompiles and maintenance.  ”UPDATEPRO” in my example is the update program “PROGRAMA” calls “UPDATEPRO” for all I/O…. FILEA and FILEB are Phyical Files.  “PROGRAMA” Program info…  WORKING-STORAGE SECTION.  01 WS-FILEA-SAVE. COPY DD-TESTREC OF FILEA.  01 WS-FILEB-SAVE. COPY DD-RECTEST OF FILEB.  01 [...]

Answer Question   |  January 26, 2011  2:15 PM
AS/400, COBOL, ILE COBOL/400, V5R4
asked by:
210 pts.

OVRDBF SHARE(*YES)
When OVRDBF SHARE(*YES) is used on “FILEA” and you have “FILEA” defined in “ProgramA” and “ProgramB”. I know that doing a READ, START etc… in either program moves the Pointer for both programs since they share the buffer. But are the FIELD values for “FILEA” the same in both programs? EXAMPLE: “PROGRAMA” READS “FILEA” and [...]

Answer Question   |  January 19, 2011  2:45 PM
AS/400, COBOL, OVRDBF
asked by:
210 pts.

We have a COBOL application running on power6 , i 570 server with OS as V5R4
We have a COBOL application running on power6 V5R4, will upgrading OS to V6R1 benefit in terms of performance.

Answer Question   |  January 15, 2011  1:09 PM
AS/400, COBOL, V5R4, V6R1
asked by:
1,160 pts.

Sending -/+ Number from VB.NET to COBOL
Is it possible for someone on the VB.NET side to send a -120 to a COBOL program? The COBOL program LINKAGE SECTION is WS-AMOUNT PIC S9(3). The only way I got it to work is having the VB.NET person to send “12}” in char field. Just figured there was a way they could send like [...]

Answer Question   |  January 13, 2011  8:20 PM
COBOL, OLE DB, VB.NET, Visual Basic, Visual Basic .NET
asked by:
210 pts.

Mainframe to AS/400
Are there conversion tool to move Mainframe cobol, JCL, CICSS, Data to AS/400? Thanks!

Answer Question   |  January 9, 2011  2:39 PM
AS/400, COBOL, File conversion tools, Mainframe
asked by:
5 pts.

MCH1202 error in COBOL/400
There are n number of ways a DDE occurs. I saw a new problem recently. Request a help from this group. Q) I have 3 Variables declared in COBOl program A(PIC 9(4)) ,B(PIC 9(4)) and C ( PIC 9(8) ) I am perfoming an arithimatic operation as follows Subtract A from B giving C. i [...]

Answer Question   |  April 15, 2011  2:32 AM
COBOL, COBOL/400, DDE, Decimal Data Error, MCH1202
asked by:
50 pts.

Execute trigger only on update of selected fields
We have created some trigger programs in COBOL that should be executed only if certain fields change. When creating a SQL-After trigger and -program on a file I can specify that the trigger should run only when specified fields are updated by using: AFTER UPDATE OF {fields} ON {file}. Unfotunately when removing a SQL trigger [...]

Answer Question   |  January 4, 2011  11:00 AM
AS/400, AS/400 triggers, COBOL, SQL Trigger, Triggers
asked by:
810 pts.

Using API QC3ENCDT in encryption using RSAalgorithm under a Public key, error CPF9DDB !
Hi I have been working on Encryption/Decryption of data on AS400 v5R4. I have already done the Encryption of data using QC3ENCDT API on COBOOL. Now, I want to use the RSA Public key to encrypt my encryption key. For that I had written a test program but it is throwing one error and I [...]

Answer Question   |  December 13, 2010  8:27 AM
AS/400, COBOL, Data Encryption, RSA Adaptive Authentication, V5R4
asked by:
55 pts.

Copy Spooled File to a Source Physical File Member
How do I copy a spooled file listing into a member of a source physical file? I accidentally deleted the source member, but have a spooled copy taken via option 6.  I would like to convert the spooled file back into the deleted member.

Answer Question   |  December 9, 2010  4:13 PM
AS/400, COBOL, Copy File, i5, iSeries, Source Physical File, Spooled File
asked by:
15 pts.

Example of Cobol call to an SQL stored procedure
I am new to the iSeries and need to know how to use a Cobol program to call an SQL stored procedure. Someone has already created the stored procedure for me, but I am not sure how to call stored procedures in Cobol on the iSeries. The passed data looks like: FIND_CLIENT ( IN LastName [...]

Answer Question   |  December 3, 2010  6:05 PM
COBOL, iSeries, iSeries Cobol programming, SQL stored procedures, Stored Procedures
asked by:
5 pts.

Count unique characters in field in batch Cobol
Please adwise how to count number of unique characters (any character can be)  in batch cobol. Thanks

Answer Question   |  November 24, 2010  4:48 PM
Batch jobs, COBOL, COBOL statements
asked by:
5 pts.

Pass Ticket with CA-ACF2
From Cobol in CICS TS 4.1, can you use the VERIFY command to validate a temporary Pass Ticket instead of a permanent ACF2 password? If not, how do you validate a  temporary Pass Ticket?

Answer Question   |  October 22, 2010  6:14 PM
CICS, CICSTS, COBOL, PassTicket
asked by:
5 pts.

Field level validation in AS/400 iSeries
Hi,     I want to transfer control to cobol on every field of screen using TAB. How?  

Answer Question   |  October 14, 2010  10:41 AM
*QRYDFN, AS/400, AS/400 commands, COBOL
asked by:
5 pts.

OPM COBOL Calling ILE Program – Passing Parameters
I have created two modules. One with the CRTCBLMOD. This is *MODULE type named TESTCBLLE. The other one, using the CRTCMOD, I created *MODULE type named TESTCILE. Then I used the CRTPGM to create the single program TESTING with the *PGM type and the attribute *CBLLE. When I did the CRTPGM command, the first entry [...]

Answer Question   |  October 14, 2010  3:27 PM
CL Parameters, COBOL, COBOL ILE, ILE Program
asked by:
185 pts.

Calling C ILE Procedure from COBOL 400 Program
I cannot get the parameters correct on this. I created a module for both the C and the COBOL, then used CRTPGM. My COBOL has WS-FIRST-COBOL-NUM PIC S9(2), WS-SECOND-COBOL-NUM PIC S9(2), WS-NUM-TOTAL-COBOL PIC S9(3) defined in WORKING-STORAGE.                Then I use those for my call to the C procedure as: CALL PROCEDURE “TESTC” USING WS-FIRST-COBOL-NUM WS-SECOND-COBOL-NUM [...]

Answer Question   |  October 20, 2010  8:49 PM
AS/400 Parameters, COBOL, COBOL/400, ILE Program
asked by:
185 pts.

Calling C ILE Program from COBOL 400 ILE Program
[html xmlns=""> I need help in figuring out how to call a C ILE program from a COBOL 400 ILE program. In my example I would like to pass three parameters from the COBOL program (num1, num2, total) to the C program. In the COBOL program I will hardcode the numbers as, say, 9 for [...]

Answer Question   |  October 1, 2010  2:22 AM
CL Parameters, COBOL, COBOL ILE, COBOL/400, ILE Program
asked by:
185 pts.

How do you initiate a direct web service call from the AS/400?
How do you initiate a direct web service call from the AS/400? I am programming in 400/COBOL. I am assuming I need to use COBOL ILE.

Answer Question   |  September 30, 2010  6:51 PM
AS/400, COBOL, COBOL ILE, COBOL/400
asked by:
185 pts.

Using AS400 COBOL or CL Program to Call an Excel File and Pass Parameters Back and Forth from 400 to Excel Back to 400
[html xmlns=""> I am beginning my investigation to figure out how to use either a 400/COBOL program or a CL program to call an excel spreadsheet that requires three parameters to a calculation and to return a value back to my 400/COBOL program of CL program so that I then can use that value in [...]

Answer Question   |  September 30, 2010  1:58 AM
AS/400, CL Program, COBOL, excel, Parameters
asked by:
185 pts.