Mainframe Languages

356

Solutions

429

Contributors

There are many computer languages, and they have been evolving from machine language into a more natural way of writing. Languages are generally classified into machine language (direct machine code); assembly (using mnemonics to present the instructions to be translated later into machine language by an assembly program); procedural languages, also known as high-level languages (HLL) (Pascal, FORTRAN, Algol, JCL, COBOL, REXX, PL/I, Basic, and C are common), along with several other types. Mainframe programming is largely done in the procedural languages.

Share tech news, updates, or what's on your mind.

Sign up to Post

Dear All,
I am Trying to read the record in Update mode which is being locked by another program
I have added the Code in the program  if the Particular record has locked then i have to display the Error message
/Free                                            
  Chain k1 filename;
         If %Status=01218;                              
            msg='Record Being Locked by Another User';  
         EndIf;                                          
/End-Free                                        
The Above Mention is the Code but it is not working
Can any one Suggest what Should i Do to solve the same

Regards,
Bsidmis

0
I have 50 character long filed in one of the file. The user can enter data in free text format.. like
8172585858 ABC cell  XYZ work 52475485855 etc..  I need to do coding in RPGLE to generate the report with all the phone number from this field (without any character) . How do i do that.

I'm new for RPGLE.

FYI : The source code is not available for us to change that 50 character  long filed in one of the file.

[code]I have 50 character long filed in one of the file. The user can enter data in free text format.. like
8172585858 ABC cell  XYZ work 52475485855 etc..  I need to do coding in RPGLE to generate the report with all the phone number from this field (without any character) . How do i do that.
I'm new for RPGLE.
FYI : The source code is not available for us to change that 50 character  long filed in one of the file.
[/code]
0
Our programmer has left and I have a task that must be completed.  We currently have an RPG program that sends output directly to a printer.  Corporate wants to rollup the reports to a softcopy to save paper.   I am no RPG programmer.

I took the orginal file (attached) that output to two printers and added what I thought would be code to get it to output to a file.  When I run the program using the lines in the code section below, I still get the printed output, but no file is created.  I expected to see ADPFCH.

Not sure what I am doing wrong.  The second attachment is what I came up with.  I tried making it look like other reports that do rollup correctly, apparently I am missing something.  Would greatly appreciate any help.

Joe


[code]0024.00              PGM                                                        
0025.00              OVRDBF     FILE(ADTRAN) TOFILE(MYLIB/ADTRAN1)
0026.00              OVRDBF     FILE(ADPCKFCH) TOFILE(MYLIB/ADPFCH)
0027.00              CALL         PGM  MYLIB/WELRPT)
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
 F3=Exit   F5=Refresh   F9=Retrieve   F10=Cursor   [/code]…
0
I am trying to read a variable length record in mainframe using C programming language. But i am not able to get the desired output. Generally in COBOL when we read a VB file, the first 4 bytes constitutes the length of the record and the remaining is the data. Similarly is there any means to read the length of the record and then the data? I had attached the code below.

The issue I am facing is  in C it data is read as stream and there is a last character x'15' is read at end of every line. I need to skip reading of x'15'. The catch here is my data also contains x'15' and i can't ignore all of them.

Let me know if any other information is required.
[code]#include<stdio.h>
#include <stdlib.h> 
int main()
{
    unsigned int str_len = 0;
    unsigned char *str;
    FILE *fp;
    if ( !(fp = fopen("dd:TEST", "rb, recfm=vb, lrecl=133") ) )
    {
         printf("Error in Opening Input File\n");
         return -1;
    }
    while(!feof(fp))
    {
         fread(&str_len, 4, 1, fp);
         str = calloc(str_len, sizeof(unsigned char));
         fread(str, str_len, 1, fp);
         printf("Data in the line %s\n", str);
         free(str);
    }
    return 0;
}
[/code]
0

Hello All,
I am having a Physical file(Flat File with one field of record Length 1700)  which is having 5000 record ftped from the client every 30 minutes , there is a batch job (RPG Program) which then loads the file in to our application system basically every 30 minutes.

OK the problem is I am getting Decimal data Error in the RPG PGM,
Question is:
1.When I take RPG Dump How can I read this Dump?
2.When I debug this PGM using STRDBG  How can I get to the Exact record  which is having this error.
3.CL PGM is calling this RPG PGM, so which on I have to Debug
4.What it Production Update(*yes) Mean?
5.Any useful Debugging Tips will be Help full.

Thanks
Oramcle
0
I have developed a CICS application with a Main Menu BMS map and then a sub menu BMS map in a separate program.  I use a XCTL to get from one program to the next.  The first Map looks great and I respond with a key and it indeed goes to the second program but the first map is still displayed.  If I do a reset clear on the keyboard the next map of the sub menu is displayed does any one know what I am doing wrong?  Even though this is on windows a Mainframe CICS person may know what I am doing wrong.
Thanks
0
Can somebody share their knowledge of the prices for 1) Microfocus COBOL NetExpress, 2) Microfocus COBOL NetExpress for .Net and 3) Microfocus Ryland Mcfarland R/M COBOL?  I've contacted the MicroFocus sales department but they can take up to 48 hours to respond.  Meanwhile, I'm looking for a general idea of their pricing.  They charge for the development environment & the runtimes.  I'm trying to find out the cost of both.  

I'm also looking into Fujitsu NetCOBOL which seems to integrate with VB.  Does anybody know of any other good COBOL compilers that can build a GUI app or integrate with VB to build a GUI app?  My goal is to create a deployable Windows GUI COBOL application which also uses ActiveX/COM.
0
I have an iSeries RPG program that writes a report using a printer file that has a dozen different record formats.  I need a way to repeat the printing of each page, without having to read through the data files a second or third time, and my solution is to capture the printer output and write to a file as a string of 132 characters.  I would like to avoid having to write a dozen routines to parse each record format as it is written and just save the 132 character buffer.  Is there a way to do this?
0
Hi All,

We are using an OS/400 application that predominantly runs on COBOL/400 programs. One of our performance intensive program is being converted into a service program model. In this model, we have removed all DB2 queries that were within the COBOL programs and have docked them into RPG programs. The RPG programs are part of a service program. All the COBOL and RPG programs are created under a single activation group.

This is a basic flow of how our programs now run:

Run CL à Calls COBOL program à Call to Service program when DB2 queries are to be executed (DB2 Queries are docked into RPG programs)

The processing of the program runs fine for most part of the program. We however receive an SQL 901 when trying to execute the following query:

PP#PYM025#3000A   B                   EXPORT                            
DP#PYM025#3000A   PI                                                    
DIN_CHAR_VAR1                         LIKE(BSM_VAR1) CONST          
DIN_CHAR_VAR2                         LIKE(BSM_VAR2) CONST        
DIN_CHAR_VAR3                         LIKE(BSM_VAR3) CONST          
DIN_CHAR_VAR4                         LIKE(BSM_VAR4) CONST        
DIN_CHAR_VAR5                   10A   CONST                            
DIN_DATETIMESTAMP_VAR6                LIKE(BSM_VAR6) CONST        
DSQLCOD                               LIKE(SQLCODE)                    
C/EXEC SQL                                                              
C+ UPDATE …
0
I have an old rpg progam that I had to make some changes to, so while i was at it, i updated it to rpgle.
Now i can't  get it to compile.
It baulks on the 2 lookup

Factor 1 '-' and Factor 2 P are not the same type and length; the specification is ignored.              
Not sure why
[code]dp                s             15    dim(1) ctdata perrcd(1)
...
c                   eval      x = 1                                  
c                   movea     dprdno        p                        
c     '-'           lookup    p(x)                               44  
c                   if        *in44 = *on                            
c                   eval      x = x + 1                              
c     '-'           lookup    p(x)                               45  
c                   if        *in45 = *on                            
c                   eval      x = x + 1                              [/code]
0
I have subfile that is ready to display.  In this instance, I need to change the order of the records in the subfile directly before it is displayed to the user.  I can write code and change the RRN, and display the subfile.  The problem is, the order is still the same.  How can I tell the display that the RRN is different, and get the subfile to display in the order I define with the RRN.  
0
We are getting stuck with scheduled tasks. While we have implemented the solution from
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_22063360.html

It does not work in Vista

If we use 'schtasks' to schedule a task under the current user in Vista, it asks for their password

Is there a way that can work on Vista and XP/
0
So i recently used the GPO option for folder redirection and it worked great creating a new folder on the new server for users "my documents".  But now when we try to use the Terminal Services (mstsc) all i get is a blue screen.  Terminal Services is crucial to our business and runs RM/Cobol for software purposes.  Why did folder redirection give me a blue screen?

HELP my job is on the line.
0
Hi guys,
 i get compile error when I use the code 1, and SOC4 error when I use the code 2. This is in language PLI (mainframe)

1) Compile Error: UNUSABLE HOST VARIABLE HOST_VAR
I am declaring HOST_VAR as 02 level.

DCL  01 STRUC,
             02 VAR1               CHAR(10),
             02 VAR2               CHAR(5),
              02  HOST_VAR USAGE IS SQL TYPE IS CLOB (10M);

EXEC SQL
  SELECT :HOST_VAR FROM SYSIBM.SYSDUMMY1;

2) S04 error  : Indexing or subscripting outside defined limits
When I am declaring  HOST_VAR as seperate 01 level

01 HOST_VAR USAGE IS SQL TYPE IS CLOB (10M);

EXEC SQL
  SELECT :HOST_VAR FROM SYSIBM.SYSDUMMY1

any ideas?
0
Hello All,
I have the Job Log for one RPG PGM, Which i am seeing  Source number 273
Decimal Data Error, But when i check the The RPG PGM the actual Source number
is commanted,

This is the Production Program I cannot compile this PGM also, is ther is any way
to find actual Source line based on this MSG.

TIA- Oramcle
0
Hi All

First of all many thanks in advance, I am a relative newbie to RPG and I need a little help if you can?

I need to write a program that cycles down an input file that has two fields:

RECID (8N),PODID (20N)

For each record in the INPUT file, it needs to read RECID chain off to a logical file called "ORDERS" on ORD40 (8N)and update a FIELD called POD40 (20N) with the data that is in PODID.

I dont have a logical file created on the input file as it is just file that comes from an external system. I can make sure that all the programs are in the same Library.

Anyone got a sample program or structure I can use to do this?

Eventually I need to make sure this runs every hour.

Cheers
BoltonWanderer
0
I have written many subfile RPG programs.  I have a need for a program to one of the following:  (1) write out an extended sub file record (record 1,2,3 my be extended - taking up 2 lines each, record 4,5,6 may not be extended - taking up 1 line each.
(2) write out the sub file, then be able to overlay one of the subfile records with a different layout.  (While writing out the subfile, I will know that I need an extra line, so I will write a blank subfile record, then do I will go back and overwrite the subfile record.
(3) be able to write different record formats in the same subfile:

The subfile would look like the following:

Customer    Item          Date
ABC Cust   Wedge1   5/15/09
    Forcast of 30
CDE Cust   Wedge2    5/30/09
    Forecast of 50
FGH Cust   Wedge3   5/30/09
    Forecast of 25
AAA Cust  Wedge4   5/30/09
BVB Cust   Wedge5  5/30/09

Thanks!
0
Hi guys: Can any one please tell me any cobol compiler which i can install on windows XP environment? I am currently using Fujitsu Netcobol studio but it starts given me that error:

This file is not authorize at this time: AUTHORIZATION TIME_SETBACK.

Dont know looks like its not free.

Thanks.
0
Hi: Can any one please tell me what is vsam and where it use in cobol? can i use it on windows xp environment?

Thanks.
0
Hi: Can any one please tell me why it gives syntax error on accept statement if i use that picture

77  VOUCHER-AMOUNT-FIELD         PIC ZZZ,ZZ9.99-.
ACCEPT VOUCHER-AMOUNT-FIELD FROM CONSOLE.

Same syntax error if i use that picture with date
77  FORMATTED-DATE     PIC Z9/99/9999.

Thanks.
Thanks.

[code]IDENTIFICATION DIVISION.
 PROGRAM-ID. VCHMNT01.
 ENVIRONMENT DIVISION.
 INPUT-OUTPUT SECTION.
 FILE-CONTROL.
            SELECT VENDOR-FILE
                  ASSIGN TO "vendor"
                  ORGANIZATION IS INDEXED
                  RECORD KEY IS VENDOR-NUMBER
                  ALTERNATE KEY IS VENDOR-NAME WITH DUPLICATES
                  ACCESS MODE IS DYNAMIC.
            
            SELECT VOUCHER-FILE
                  ASSIGN TO "VOUCHER"
                  ORGANIZATION IS INDEXED
                  RECORD KEY IS VOUCHER-NUMBER
                  ACCESS MODE IS DYNAMIC. 
     SELECT CONTROL-FILE
                 ASSIGN TO "CONTROL"
                 ORGANIZATION IS INDEXED
                 RECORD KEY IS CONTROL-KEY
                 ACCESS MODE IS DYNAMIC. 
 DATA DIVISION.
 FILE SECTION. 
    FD        VENDOR-FILE
                 LABEL RECORDS ARE STANDARD.
    01        VENDOR-RECORD.
                 05  VENDOR-NUMBER            PIC 9(5).            
                 05  VENDOR-NAME              PIC X(30).
                 05  VENDOR-ADDRESS-1         PIC X(30).
                 05  VENDOR-ADDRESS-2         PIC X(30).
                 05  VENDOR-CITY              PIC X(20).
                 05  VENDOR-STATE             PIC X(2).
                 05  VENDOR-ZIP               PIC X(10).
                 05  VENDOR-CONTACT           PIC X(30).
                 05  VENDOR-PHONE             PIC X(15). 
    FD        VOUCHER-FILE
                 LABEL [/code]…
0
Hi: Can any one please tell me where that error is. I make three files to create data file in OUTPUT mode and then i run the main file but the main file gives runtime error.

Thanks.

[code]IDENTIFICATION DIVISION.
 PROGRAM-ID. VCHBLD01.
*---------------------------------
* Create a Voucher file for the
* bills payment system
*---------------------------------
 ENVIRONMENT DIVISION.
 INPUT-OUTPUT SECTION.
 FILE-CONTROL.
     SELECT VOUCHER-FILE
           ASSIGN TO "VOUCHER"
           ORGANIZATION IS INDEXED
           RECORD KEY IS VOUCHER-NUMBER
           ACCESS MODE IS DYNAMIC.
 DATA DIVISION.
 FILE SECTION.
       FD  VOUCHER-FILE
             LABEL RECORDS ARE STANDARD.
       01      VOUCHER-RECORD.
             05  VOUCHER-NUMBER           PIC 9(5).
             05  VOUCHER-VENDOR           PIC 9(5).
             05  VOUCHER-INVOICE          PIC X(15).
             05  VOUCHER-FOR              PIC X(30).
             05  VOUCHER-AMOUNT           PIC S9(6)V99.
             05  VOUCHER-DATE             PIC 9(8).
             05  VOUCHER-DUE              PIC 9(8).
             05  VOUCHER-DEDUCTIBLE       PIC X.
             05  VOUCHER-SELECTED         PIC X.
             05  VOUCHER-PAID-AMOUNT      PIC S9(6)V99.
             05  VOUCHER-PAID-DATE        PIC 9(8).
             05  VOUCHER-CHECK-NO         PIC 9(6).
 
 WORKING-STORAGE SECTION. 
 PROCEDURE DIVISION.
 PROGRAM-BEGIN.
     OPEN OUTPUT VOUCHER-FILE.
     CLOSE VOUCHER-FILE. 
 PROGRAM-EXIT.
     EXIT PROGRAM. 
 PROGRAM-DONE.
     STOP RUN.
------------------------------------------------------------------------
 [/code]…
0
I want a create a procedure to generate 3 different resultsets and these resultset will be returned to a method.
Ihave tried to return multiple resultset ,(If these the program is debugged in green screen it shows all 3 resultset are populated)
However. if the Java procedure is debuged it shows only the first DS as resultset and remaining DS are not returned (Java gets a null if tries to get it)

PS: java method cstmt.getMoreResults() returns false for the resultsets after first.
0
Hi guys: There is a syntax error on the variable which i already define above but dont understand that why it gives syntax error on both of them.

ACCEPT VOUCHER-AMOUNT-FIELD.
ACCEPT FORMATTED-DATE.

[code]IDENTIFICATION DIVISION.
 PROGRAM-ID. VCHMNT01.
 ENVIRONMENT DIVISION.
 INPUT-OUTPUT SECTION.
 FILE-CONTROL.
            SELECT VENDOR-FILE
                  ASSIGN TO "vendor"
                  ORGANIZATION IS INDEXED
                  RECORD KEY IS VENDOR-NUMBER
                  ALTERNATE KEY IS VENDOR-NAME WITH DUPLICATES
                  ACCESS MODE IS DYNAMIC.
            
            SELECT VOUCHER-FILE
                  ASSIGN TO "VOUCHER"
                  ORGANIZATION IS INDEXED
                  RECORD KEY IS VOUCHER-NUMBER
                  ACCESS MODE IS DYNAMIC. 
     SELECT CONTROL-FILE
                 ASSIGN TO "CONTROL"
                 ORGANIZATION IS INDEXED
                 RECORD KEY IS CONTROL-KEY
                 ACCESS MODE IS DYNAMIC. 
 DATA DIVISION.
 FILE SECTION. 
    FD        VENDOR-FILE
                 LABEL RECORDS ARE STANDARD.
    01        VENDOR-RECORD.
                 05  VENDOR-NUMBER            PIC 9(5).            
                 05  VENDOR-NAME              PIC X(30).
                 05  VENDOR-ADDRESS-1         PIC X(30).
                 05  VENDOR-ADDRESS-2         PIC X(30).
                 05  VENDOR-CITY              PIC X(20).
                 05  VENDOR-STATE             PIC X(2).
                 05  VENDOR-ZIP               PIC X(10).
                 05  VENDOR-CONTACT           PIC X(30).
                 05  VENDOR-PHONE             PIC X(15). 
    FD        VOUCHER-FILE
                 LABEL RECORDS ARE STANDARD.
    01        VOUCHER-RECORD.
                 05  VOUCHER-NUMBER           PIC 9(5).
                 05  [/code]…
0
Hi guys: Can any one please tell me why it gives run time error in the main program. I write two files. First one i create a blank data file. When i run the second file it gives a runtime error needs help.

Thanks.

[code]IDENTIFICATION DIVISION.
 PROGRAM-ID. VNDBLD01.
*------------------------------------------------
* Create an Empty Vendor File.
*------------------------------------------------
 ENVIRONMENT DIVISION.
 INPUT-OUTPUT SECTION.
 FILE-CONTROL. 
     SELECT VENDOR-FILE
         ASSIGN TO "vendor"
         ORGANIZATION IS INDEXED
         RECORD KEY IS VENDOR-NUMBER
         ACCESS MODE IS DYNAMIC. 
 DATA DIVISION.
 FILE SECTION. 
 FD  VENDOR-FILE
     LABEL RECORDS ARE STANDARD.
 01  VENDOR-RECORD.
     05  VENDOR-NUMBER                    PIC 9(5).
     05  VENDOR-NAME                      PIC X(30).
     05  VENDOR-ADDRESS-1                 PIC X(30).
     05  VENDOR-ADDRESS-2                 PIC X(30).
     05  VENDOR-CITY                      PIC X(20).
     05  VENDOR-STATE                     PIC X(2).
     05  VENDOR-ZIP                       PIC X(10).
     05  VENDOR-CONTACT                   PIC X(30).
     05  VENDOR-PHONE                     PIC X(15). 
 WORKING-STORAGE SECTION. 
 PROCEDURE DIVISION.
 PROGRAM-BEGIN.
     OPEN OUTPUT VENDOR-FILE.
     CLOSE VENDOR-FILE. 
 PROGRAM-DONE.
     STOP RUN. 
-----------------------------------------
 IDENTIFICATION DIVISION.
 PROGRAM-ID. VNDMNT01.
[/code]…
0
Hi guys: Can any one please tell me what i make mistake here as when i enter the last name it dont ask me the first name untill i put a lot of characters in the last name field

Thanks.

[code]*>
 IDENTIFICATION DIVISION.
 PROGRAM-ID.   PHNADD01.
 ENVIRONMENT    DIVISION.
 INPUT-OUTPUT SECTION.
 FILE-CONTROL.
       SELECT OPTIONAL PHONE-FILE
             ASSIGN TO "phone.dat"
             ORGANIZATION IS SEQUENTIAL.
 DATA DIVISION.
 FILE SECTION.
 FD PHONE-FILE
 LABEL RECORDS ARE STANDARD.
 01 PHONE-RECORD.
             05 PHONE-LAST-NAME      PIC X(20).
             05 PHONE-FIRST-NAME PIC X(20).
             05 PHONE-NUMBER       PIC X(15).
 WORKING-STORAGE SECTION.
 01 PROMPT-1                        PIC X(9) VALUE "Last Name".
 01 PROMPT-2                        PIC X(10) VALUE "First Name".
 01 PROMPT-3                        PIC X(6) VALUE "Number".
 01 YES-NO                        PIC X.
 01 ENTRY-OK                        PIC X.
 PROCEDURE DIVISION.      
 MAIN-LOGIC SECTION.
 PROGRAM-BEGIN.
             PERFORM OPENING-PROCEDURE.
             MOVE "Y" TO YES-NO.
             PERFORM ADD-RECORDS
                   UNTIL YES-NO = "N".
             PERFORM CLOSING-PROCEDURE.
       PROGRAM-DONE.
             STOP RUN.
       OPENING-PROCEDURE.
             OPEN EXTEND PHONE-FILE.
       CLOSING-PROCEDURE.
             CLOSE PHONE-FILE.
       ADD-RECORDS.
             MOVE "N" TO ENTRY-OK.
             PERFORM GET-FIELDS UNTIL ENTRY-OK="Y".
             PERFORM ADD-THIS-RECORD.
             PERFORM GO-AGAIN.
       GET-FIELDS.
             MOVE SPACE TO PHONE-RECORD.
             DISPLAY PROMPT-1 "?".
             ACCEPT PHONE-LAST-NAME.
             DISPLAY PROMPT-2 "?".
             ACCEPT PHONE-FIRST-NAME.
             DISPLAY PROMPT-3 "?"
             ACCEPT PHONE-NUMBER.
             PERFORM [/code]…
0

Mainframe Languages

356

Solutions

429

Contributors

There are many computer languages, and they have been evolving from machine language into a more natural way of writing. Languages are generally classified into machine language (direct machine code); assembly (using mnemonics to present the instructions to be translated later into machine language by an assembly program); procedural languages, also known as high-level languages (HLL) (Pascal, FORTRAN, Algol, JCL, COBOL, REXX, PL/I, Basic, and C are common), along with several other types. Mainframe programming is largely done in the procedural languages.

Top Experts In
Mainframe Languages
<
Monthly
>

No Top Experts for this time period. Answer questions to earn the title!