View previous topic :: View next topic
|
Author |
Message |
srebba Warnings : 1 New User
Joined: 26 Apr 2007 Posts: 37 Location: USA
|
|
|
|
Hi
I would like to pass the value of LRECL from the JCL to cobol.
In my program the LRECL of the file 700. I have declared this in the FD section. now I am running this program thru CLIST commands
so every time I cant use the same file. so i would like to use defferent file of LRECL. Please let me know how can i do this.
thanks
sree |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Once you got the lrecl to the program, what would you do with it, recompile the FD? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I don't get the question either. An example would be nice. |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
if the record length changes for every run then make the file as variable length file and execute. |
|
Back to top |
|
|
srebba Warnings : 1 New User
Joined: 26 Apr 2007 Posts: 37 Location: USA
|
|
|
|
Sorry for the inconviance caused.
Here is my question again.
I would like to run the compare program thru CLIST commands
That compare program is simply compare the 2 files and writting the other files with duplicare records.( Mathed records)
Now I am able to pass the key value(starting and ending postion which we are going compare record) thru CLIST (eg SYSIN).
FYI-- Here i dont want touch the program.
Now I would like to run the same program for different files. So in the program I have declared FD section LRECL. Now If i want to run the same program with defferent file LRECL then i need to pass to the program thru CLIST. so that program can run. so how can i pass the LRECL lengh to program?
Please let me know if iam not clear.
Thanks
Sree |
|
Back to top |
|
|
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
I have not tried this but can this help you?
Declaring the file in the progam with the recording mode as "S" (spanned)
I have a question for you,
But your requirement is comparison and duplicate removal through a COBOL program,for this comparison you need to specify a key.If this key position varies based on the files,how will you comapre then? |
|
Back to top |
|
|
srebba Warnings : 1 New User
Joined: 26 Apr 2007 Posts: 37 Location: USA
|
|
|
|
yes, I am passing the key value thru CLIST.
For Eg. I have 2 files with LRECL 600 and 500 (whatever we declare in the program) then we can compare by passing the key value(starting and ending postion variables). But if I need to compared any other two files with the same program i need to change the FD LRECL. so I need to overight without touch the program as iam passing the key values.
Please let me know if iam not crear.
Thanks
Sree |
|
Back to top |
|
|
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
I will put it this way.there are 2 files.Let the key field to compare and remove the duplicates be account number.
file 1 is of record length 500 and file 2 is of recored length 600. The account number is 3 digit and is present in position 3-5 in file 1 and 10-12 in file2.
You have the cobol code in which you read the record from file1 ,file2.
Now you are comparing file1-account(3:5) with file2-account(10:3) and based on some logic you are removing the duplicate.
Now assume you are using different LREC's may be 700 and 900 andthe key field postion also varies.In this case the same program logic cannot be used for the comparison if the key position/length varies
Hope this may help you. |
|
Back to top |
|
|
ramfrom84
New User
Joined: 23 Aug 2006 Posts: 93 Location: chennai
|
|
|
|
Hi,
Solution For LREC Problem:
Define the two File as Variable File in the Program say as max Size (ex 1000) it will accept the input file Size from (1 to 1000) So no need to change the LREC in the program ,
For comparsion Key Field:
Passes VALUE thru PARM
define in program linkage section
Code: |
05 KEY1_ST PIC 9(5)
05 kEY1_ED PIC 9(5)
05 KEY2_ST PIC 9(5)
05 kEY2_ED PIC 9(5)
|
In JCL pass the value according to ur requriment .
In program
Code: |
IF INPUT_FILED1(KEY1_ST : kEY1_ED) = INPUT_FILED2(KEY2_ST : kEY2_ED)
THEN WRITE O/P RECORD
|
I Think it would solve the problem |
|
Back to top |
|
|
srebba Warnings : 1 New User
Joined: 26 Apr 2007 Posts: 37 Location: USA
|
|
|
|
Hi,
I did for the keys already like this. As I told iam passing the key values thru CLIST and iam comparing.
But the thing is I would like pass the LRECL as just like passing the key values so that the program can run for anyother two files without touch program.
I think U can understand the situation.
Please help me out------------------
Thanks
Sree |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Passing the lrecl is easy, what is the recfm? |
|
Back to top |
|
|
ramfrom84
New User
Joined: 23 Aug 2006 Posts: 93 Location: chennai
|
|
|
|
As Wiiliam asked what is the record format... dont think only about LREC .
If u r using Variable Length format u wont worrry about LREC,
I have two question for u:
1. The progam is written by u or it is Common module that can't be changed? If u have permission to change the program then it is one time Change ( Fixed Length TO Variable Length)
2. U want to be done only with COBOL or other method such as EASYtrieve
Example : easytrieve program to compare the two file(Dont worry about the Key and LREC)
Code: |
FILE IFLE1
IFLE1-LREC 1 183 A
IFLE1-KEY 1 14 A
FILE IFLE2
IFLE2-LREC 1 280 A
IFLE2-KEY 1 14 A
FILE OFLE3 FB(183 0)
OFLE3-LREC 1 183 A
OFLE3-KEY 1 14 A
JOB INPUT (IFLE1 KEY(IFLE1-KEY), IFLE2 KEY(IFLE2-KEY))
IF MATCHED
PUT OFLE3 FROM IFLE1
END-IF.
|
That All............ |
|
Back to top |
|
|
|