|
|
| Author |
Message |
trumpcards Warnings : 1 New User
Joined: 03 Jul 2006 Posts: 8
|
|
|
|
There are 2 different JCLs which uses the same COBOL program. But The input file length is different in two jcls. How can we define and use in the COBOL program.
EX:
JCL1 has input file of 650 length and JCL2 has 750 length. Output file lenths are same. These 2 jCls have to call the same program. How can we define and use in the COBOL program. |
|
| Back to top |
|
 |
References
|
|
 |
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 298 Location: Bang,iflex
|
|
|
|
Hi,
This can be handled using PARM of JCl
you have to define SELECT statement for both of th file means for input files having length 650 and 750,
so when you are executing program with input file length 650 code as below.
JCL1
| Code: |
// JOB CARD
//STEP1 EXEC PGM = COBOLPGM, PARM = '1'
//INFILE1 DD DSN = DATA.SET.NAME(650 LENGTH), DISP=SHR
//OUPUT DD DSN = OUT.PUT.DATA(SAME LENGTH), DISP=SHR
//SYSIN DD DUMMY
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=* |
You can handle the PARM value in cobol program if PARM value is 1, open the dataset having length 650 and process write the output file.
If ur executing a program with input file having length 750
JCL2
| Code: |
// JOB CARD
//STEP1 EXEC PGM = COBOLPGM, PARM = '2'
//INFILE1 DD DSN = DATA.SET.NAME(650 LENGTH), DISP=SHR
//OUPUT DD DSN = OUT.PUT.DATA(SAME LENGTH), DISP=SHR
//SYSIN DD DUMMY
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=* |
You can handle the PARM value in cobol program if PARM value is 2, open the dataset having length 750 and process and write the output file.
You can change the PARM value acording to your desire........  |
|
| Back to top |
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3300 Location: Charlotte,NC USA
|
|
|
|
| Why can't you pre-process the input files and make them both the same length BEFORE calling the program? |
|
| Back to top |
|
 |
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 298 Location: Bang,iflex
|
|
|
|
Hi Superk,
I also took the assignment of same scenario, so i hamdled like this and also requirement was also like this only, so i didnot get any chance to preprocess the file.
if you have any idea please suggest us. |
|
| Back to top |
|
 |
revel
Active User
Joined: 05 Apr 2005 Posts: 132 Location: Bangalore/Chennai-INDIA
|
|
|
|
Hi Superk,
| Quote: |
| Why can't you pre-process the input files and make them both the same length BEFORE calling the program |
Could you please tell me how can i do approach for this? |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 8724 Location: 221 B Baker St
|
|
|
|
Hello,
| Quote: |
| Could you please tell me how can i do approach for this? |
Sort, IEBGENER, etc.
Just copy the file to another with the common dcb info.
If the data actully has different lengths, will there not be some inconsistencies in the "common" cobol program? What will be done to handle the "missing" or "extra" bytes? |
|
| Back to top |
|
 |
revel
Active User
Joined: 05 Apr 2005 Posts: 132 Location: Bangalore/Chennai-INDIA
|
|
|
|
Hello,
| dick scherrer wrote: |
| Quote: |
| Could you please tell me how can i do approach for this? |
Sort, IEBGENER, etc.
Just copy the fine to another with the common dcb info.
If the data actully has different lengths, will there not be some inconsistencies in the "common" cobol program? What will be done to handle the "missing" or "extra" bytes? |
Is that good coding practice more over he given requirement cleary that there are 2 JCL which uses common COBOL program but 2 JCL(Which could be RUN at different interval)
Is I am correct Dick, |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 8724 Location: 221 B Baker St
|
|
|
|
Hello Raghu,
It is rather common to have a program that is executed in multiple jobs (often even more than 2). What is not so common is to have the same program process the "same" file with different lrecls. The original question needs clarification. . .
Usually if lrecls are different, that means the files are different and would usually be dealt with in different code. Even if the "short" file were copied to a file with the longer lrecl, the last 100 bytes would be useless.
If we had better information we could make better suggestions. |
|
| Back to top |
|
 |
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 1199 Location: At my desk
|
|
| Back to top |
|
 |
jasorn
Active User
Joined: 12 Jul 2006 Posts: 109
|
|
|
|
| You can also use one fd by coding record contains 0. |
|
| Back to top |
|
 |
|
|