Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Pass the value of LRECL from the JCL to cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
srebba
Warnings : 1

New User


Joined: 26 Apr 2007
Posts: 37
Location: USA

PostPosted: Wed May 16, 2007 2:29 am    Post subject: Pass the value of LRECL from the JCL to cobol
Reply with quote

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
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed May 16, 2007 2:37 am    Post subject:
Reply with quote

Once you got the lrecl to the program, what would you do with it, recompile the FD?
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed May 16, 2007 8:38 am    Post subject: Re: pass the value of LRECL
Reply with quote

I don't get the question either. An example would be nice.
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Wed May 16, 2007 10:48 am    Post subject:
Reply with quote

if the record length changes for every run then make the file as variable length file and execute.
Back to top
View user's profile Send private message
srebba
Warnings : 1

New User


Joined: 26 Apr 2007
Posts: 37
Location: USA

PostPosted: Wed May 16, 2007 6:59 pm    Post subject: Re: Pass the value of LRECL from the JCL to cobol
Reply with quote

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
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Wed May 16, 2007 7:37 pm    Post subject: Re: Pass the value of LRECL from the JCL to cobol
Reply with quote

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
View user's profile Send private message
srebba
Warnings : 1

New User


Joined: 26 Apr 2007
Posts: 37
Location: USA

PostPosted: Wed May 16, 2007 9:42 pm    Post subject: Re: Pass the value of LRECL from the JCL to cobol
Reply with quote

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
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Thu May 17, 2007 4:09 pm    Post subject: Re: Pass the value of LRECL from the JCL to cobol
Reply with quote

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
View user's profile Send private message
ramfrom84

New User


Joined: 23 Aug 2006
Posts: 93
Location: chennai

PostPosted: Thu May 17, 2007 7:26 pm    Post subject:
Reply with quote

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
View user's profile Send private message
srebba
Warnings : 1

New User


Joined: 26 Apr 2007
Posts: 37
Location: USA

PostPosted: Thu May 17, 2007 11:57 pm    Post subject: Re: Pass the value of LRECL from the JCL to cobol
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri May 18, 2007 5:27 am    Post subject:
Reply with quote

Passing the lrecl is easy, what is the recfm?
Back to top
View user's profile Send private message
ramfrom84

New User


Joined: 23 Aug 2006
Posts: 93
Location: chennai

PostPosted: Fri May 18, 2007 3:39 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us