|
|
| Author |
Message |
sasanka
New User
Joined: 18 Jan 2008 Posts: 5 Location: chennai
|
|
|
|
Hi,
I wrote a REXX program which read record from a file and provide this record as an input to a COBOL program at run time and that COBOL program write that record to the output file and the REXX executes the COBOL program in a loop until the end of the file is reached.
COBOL CODE is given below :
| Code: |
IDENTIFICATION DIVISION.
PROGRAM-ID. PGM1.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT OUT-FILE
ASSIGN TO OUTFILE.
DATA DIVISION.
FILE SECTION.
FD OUT-FILE.
01 OUT-REC PIC 9(04).
WORKING-STORAGE SECTION.
01 NUM1 PIC 9(3).
01 NUM2 PIC 9(3).
PROCEDURE DIVISION.
ACCEPT NUM1
ACCEPT NUM2
OUT-REC = NUM1 + NUM2
WRITE OUT-REC
DISPLAY 'NUMBER : ' OUT-REC
GOBACK.
|
REXX CODE is given below :
| Code: |
/*REXX PROGRAM TO EXECUTE A COBOL PROGRAM IN LOOP*/
"EXECIO * DISKR MYINDD1 (STEM LINE1. FINIS"
"EXECIO * DISKR MYINDD2 (STEM LINE2. FINIS"
DO I = 1 TO LINE1.0 AND J=1 TO LINE2.0
"//JOBLIB DD DSN=HFH1.EN@IDEV.HFH.BATCH.LOADLIB.Y2K,DISP=SHR"
"//STEP01 EXEC PGM=PGM1"
"//SYSIN DD*"
" LINE1.I "
" LINE1.J "
"/*"
"//OUTFILE DD DSN=A333.FILE.REXXOUT,DISP=SHR"
"//SYSPRINT DD SYSOUT=*"
"//SYSOUT DD SYSOUT=*"
END
EXIT
|
The JCL executing the REXX program is
| Code: |
//STEP01 EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//MYINDD1 DD DSN=A333.FILE.REXX1,DISP=SHR
//MYINDD2 DD DSN=A333.FILE.REXX2,DISP=SHR
//SYSTSIN DD *
EX 'A333.REXX.TEST(REXXPGM1)'
/*
//SYSOUT DD SYSOUT=*
|
The contents of input file A333.FILE.REXX1 is:
123
567
003
The contents of input file A333.FILE.REXX2 is:
234
667
440
The output file name is A333.FILE.REXXOUT.
My program executed successfully, but the output file becomes empty.
Thanks,
Sasanka |
|
| Back to top |
|
 |
References
|
Posted: Fri Apr 18, 2008 3:56 pm Post subject: Re: REXX executes the COBOL program in a loop |
 |
|
|
 |
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 2523 Location: Brussels once more ...
|
|
|
|
| So where is the COBOL program executed ? |
|
| Back to top |
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3008 Location: Charlotte,NC USA
|
|
|
|
| The REXX code is syntactically incorrect, and doesn't do anything. What are you really trying to accomplish here? |
|
| Back to top |
|
 |
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 2523 Location: Brussels once more ...
|
|
|
|
| Yeah, why not just run the COBOL program with the input ? |
|
| Back to top |
|
 |
karthikraman_m
New User
Joined: 10 Jun 2005 Posts: 14 Location: India
|
|
|
|
Hi Sasanka,
You are trying a situation of JCL calling Rexx and this Rexx inturn submitting a Job with a Cobol program ????? Nice Experiment :-)
Anyhow, the Rexx program only contains the JCL steps in a Do loop......It does not submit your job. Check that !!! You need to submit the job to get it executing the COBOL program.
Thanks,
Karthik Raman |
|
| Back to top |
|
 |
|
|