COBOL Questions


COBOL/400 – Time stamp
Hi, could anyone please advice me how to use time stamp in COBOL/400?

Answer Question   |  May 15, 2013  4:58 AM
AS/400, CLLE, COBOL
asked by:
525 pts.

CPF5011 COBOL subfile error
I have not written a subfile program in a while, but am having trouble when errors are encountered. As this is COBOL and the code can be lengthy to weed through on a forum, let me first spell out the scenario. I have 32 records in a COBOL subfile, 11 per page. There is one [...]

Answer Question   |  April 26, 2013  2:09 PM
AS/400, AS/400 Subfiles, COBOL
asked by:
185 pts.

iSeries SQL Cobol
In my COBOL SQL select statement that was previously running on V5R4, I was able to extract a date field defined with “date” as the data type. We are now on V7R1 and we get a data mapping error. No clue as to why? Any ideas? thanks

Answer Question   |  April 2, 2013  6:59 PM
COBOL, iSeries, SQL statement
asked by:
10 pts.

COBOL PGM for extracting fields from mulitple files to a flat file
Hi, Please help me with an need an example COBOL program for the below mentioned requirements. Extract fields from 3 files based on selection criteria(specific to each file) and write all the records which satisfies the criteria to a flat file. Thank you.

Answer Question   |  March 22, 2013  1:30 PM
COBOL, COBOL Programs
asked by:
5 pts.

File Status 90 during open
Hi, I have a logical file, which I am trying to open in I-O mode, but I get File status 90 File is existing on the system, The code was working fine previously (on development machine), but today I installed all the objects on another machine (Testing machine), and I am getting this file status, [...]

Answer Question   |  March 18, 2013  5:39 AM
AS/400, COBOL
asked by:
225 pts.

COBOL reading RPG created files
I am trying to read a RPG created file with special characters in the data fields (EX: EP$DEPT,etc). Is there a way I can remap the fields in a COBOL program. I tried a logical mapping over the PF but when I rename the fields in the LF removing the $ sign, I get compile [...]

Answer Question   |  February 18, 2013  3:43 AM
COBOL, COBOL Programs, RPG file
asked by:
35 pts.

Validate date in COBOL/400
I have date in yyyymmdd format. I want to validate if it lies between a particular period of 2 years let b/w 1 Jan 2012 to 5 April 2014, in COBOL/400…. Please help me as the intrinsic function like that in COBOL are not working in this case. Thanks.

Answer Question   |  January 31, 2013  7:22 PM
COBOL, COBOL/400
asked by:
10 pts.

Output from COBOL display statement not showing up in log when changing userid via QWTSETP
If I change userids in my CL via QSYGETPH/QWTSETP I get no QPJOBLOG. After adding DSPJOBLOG  OUTPUT(*PRINT)  to the CL I get a joblog. But still no output from the DISPLAY statements in the program. If I don’t switch userids, I see the messages in the QPJOBLOG.    

Answer Question   |  April 25, 2012  6:48 PM
COBOL, iSeries v7r1
asked by:
5 pts.

Logical File
Hi, I have written two online programs.  The first one uses PRDATA-FILE.  The second one uses a logical file based on PRDATA-FILE.  When the screen of the first online program is displayed, the screen of the second online program does not display records.  Is this because PRDATA-FILE is locked by the first online program? How [...]

Answer Question   |  April 26, 2012  10:12 AM
AS/400 logical file, COBOL, iSeries 820
asked by:
15 pts.

Ques Regarding Date in Iseries cobol.
Hi Group, I have a date field declared as packed field of 9, and date is declared as mmddyyyy format. My requirement is such that i need to pick the date field and 1 day to it. For example if the date is ’02142012′ i need to add 1 day to it and end result [...]

Answer Question   |  March 17, 2012  9:43 PM
AS400 iseries, COBOL, PGM
asked by:
340 pts.

Dynamically create and execute COBOL statements
I’m trying to dynamically create COBOL statements using field names identified in a table, so the same build statement can be used for different fields. Is there a way to dynamically build statements and execute?  These buillt statements would be MOVE and ADD statements. Thanks in advance

Answer Question   |  March 17, 2012  3:50 PM
AS/400, COBOL, COBOL statements
asked by:
5 pts.

AS400 COBOL one pf have one lf but key fields are different
i have one physical file,that pf have one logical file,but pf have 4 key fields,logical file have 2 key fields,now both(pf,lf) are using in cobol/400 code   SELECT pf-file ASSIGN TO DATABASE-pf1 [Br _extended=”true” />ACCESS IS dynamic[Br _extended=”true” />ORGANIZATION IS INDEXED [Br _extended=”true” />RECORD KEY IS EXTERNALLY-DESCRIBED-KEY [Br _extended=”true” />FILE STATUS IS pf-STATUS. [Br _extended=”true” />[Br [...]

Answer Question   |  March 31, 2012  11:30 AM
AS/400, AS400 physical file, COBOL, COBOL/400
asked by:
345 pts.

AS400 comparing large database files, cobol code taking too long
Hi, I need to compare 2 large database files on the AS400, they have 20 million + records each. They are both keyed uniquely, exact same file layout. I need to identify inserted, updated and deleted records. I tried using cobol program reading first file with the unique logical, and matching with the second file [...]

Answer Question   |  March 31, 2012  5:30 PM
AS/400, AS/400 database, AS/400 Database File, COBOL
asked by:
25 pts.

Switch between two screens using CICS maps
how we can switch between two screens using maps in cics what will be the logic implemented in cobol programme?

Answer Question   |  March 31, 2012  2:16 AM
AS/400 DB2, CICS, CICS programs, COBOL
asked by:
5 pts.

Retrieving environmental variable
Is there a way to retrieve a Windows environmental variable from a Cobol AS400 environment?

Answer Question   |  March 31, 2012  6:03 PM
COBOL, Environmental Controls System, Windows Variable Names
asked by:
10 pts.

Check to see if a file directory exist in Windows
I am trying to find a way in Cobol, either with a program or CL to see if a file directory exists in Windows.

Answer Question   |  March 31, 2012  5:50 PM
COBOL, Windows, Windows administration
asked by:
10 pts.

COBOL/400 subfile single page load(page by page load)
Hi! can any one give me sample code of cobol/400 program which loads a subfile records page by page. My problem here is I am able to code page by page records loading from a PF but when the Subfile is dispalyed it is not properly displaying the pages. Fro example after loading and displaying [...]

Answer Question   |  March 31, 2012  8:10 AM
COBOL, COBOL/400, iSeries, Subfile, V5R3
asked by:
5 pts.

COBOL/400
Hi Group, In COBOL/400 PGM the file has been declared with ACCESS as SEQUENTIAL and ORGANIZATION as SEQUENTIAL. How to delete a record from such file? Regards, M

Answer Question   |  March 31, 2012  4:42 AM
COBOL, COBOL statements, COBOL/400, PGM
asked by:
340 pts.

Inquire storage usage
how to program cics inquire storage command in cobol to get the storage alloted to a particular task and then free the alloted storage

Answer Question   |  March 31, 2012  6:08 PM
CICS, CICS Storage, COBOL, COBOL CICS
asked by:
5 pts.

UNSTRING -DBCS and non-DBCS
“UNSTRING” contained both DBCS and non-DBCS items. My program is returning this compilation error. What is the solution. Please help. Tried many ways but didnt work.

Answer Question   |  March 31, 2012  9:40 AM
COBOL, COBOL Compiler, COBOL ERROR MESSAGE, DBCS, dbcs data, graphic datatype, unstring
asked by:
10 pts.