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
 

 

replace a programatical compare

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Ronny John

New User


Joined: 30 Mar 2010
Posts: 33
Location: USA

PostPosted: Sun Jul 10, 2011 1:33 pm    Post subject: replace a programatical compare
Reply with quote

I have two files Fie1 and file2.
File1 is a PS file created using a program having the laYOUt as given below:

01 A PIC X(1).
01 B PIC X(6).
01 C PIC X(4).
01 D PIC X(1).
01 E PIC X(1).
01 F PIC X(1).

File2 is a VSAM file having the the layout as below: U and V forms the key.

01 U PIC X(6).
01 V PIC X(4).
01 W PIC X(1).
01 Z PIC X(1).
01 Y PIC X(1).

Can you plase give me a sort that will compare the record of file1 with file2 such that For records having B=U, C=V and W=0, the E should be equal to Y, else write the record to a new File3 having teh same layout a file1.

I need to replace a program with a sort to improve time of execution.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Sun Jul 10, 2011 1:49 pm    Post subject:
Reply with quote

1 What have you tried yourself
2 What research have you done
3 Which sort product and release level is installed
4 RECFM & LRECL of file1
5 RECSZ 0f file2
6 Please do not ask for a solution straight off of the bat without trying yourself
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7307

PostPosted: Sun Jul 10, 2011 2:58 pm    Post subject: Reply to: JCL to replace a programatical cmpare
Reply with quote

I don't understand your record layouts.

Each 01 in a Cobol program starts on a double-word boundary.

Code:
01 A PIC X(1).
01 B PIC X(6).
01 C PIC X(4).
01 D PIC X(1).
01 E PIC X(1).
01 F PIC X(1).


This would be, one byte of yours, seven of undetermined value, six of yours, two of undetermined value, four, four, one, seven, one seven, one and then either none or something else depending on the LRECL.

Or, of course, you have

Code:
01  blah.
    05 A PIC X(1).
    05 B PIC X(6). 
    05 C PIC X(4).
    05 D PIC X(1).
    05 E PIC X(1).
    05 F PIC X(1).


How many records are on your files such that you have performance problems? Have you reviewed the existing method for performance improvements?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jul 11, 2011 7:10 am    Post subject:
Reply with quote

Hello,

Quote:
I need to replace a program with a sort to improve time of execution.
If the program is properly written, it should perform quite acceptably.

You have provided no detail about the existing process and there is a good likelihood that the actual code is the problem. . .
Back to top
View user's profile Send private message
Ronny John

New User


Joined: 30 Mar 2010
Posts: 33
Location: USA

PostPosted: Mon Jul 11, 2011 9:24 am    Post subject: Reply to: replace a programatical compare
Reply with quote

Bill,

You are right about the record layout thing. That was a typo from my side.
01 File1rec.
05 A PIC X(1).
05 B PIC X(6).
05 C PIC X(4).
05 D PIC X(1).
05 E PIC X(1).
05 F PIC X(1).
05 ---------
05 ---------


01 File2rec.
05 V PIC X(4).
05 W PIC X(1).
05 Z PIC X(1).
05 Y PIC X(1).
05 ---------
05 ---------

Expat,
The input to file is a GDG base having genrations created over a period of 1 Year. Manually searching the members is impossible using fileaid or file manager. So i wrote a program. I was suggested that rather than using a program its better to use a sort, but i am not that familiar in JCL.
File1 Record format is FB and LRECL is 15000.
Rec size of file 2 is 500 bytes.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jul 11, 2011 9:29 am    Post subject:
Reply with quote

Hello,

For whatever reason, you did not post some sample data. . .

From the bit you have posted, your performance issue/problem is the way you wrote the code.

You need to get the gdg collection into sorted order and then match this data against the other file. If you do the match inside a program or using the sort, both will run acceptably.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1756
Location: UK

PostPosted: Mon Jul 11, 2011 10:03 am    Post subject:
Reply with quote

I assume your program runs in batch? If so the JC you wrote to run it is very similar to the JCL you need to run a sort - job card, exec, input dd, output dd and sysin for the control cards which are NOT jcl but sort control cards.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7307

PostPosted: Mon Jul 11, 2011 2:14 pm    Post subject: Reply to: replace a programatical compare
Reply with quote

So, you will certainly need to sort your 300+ generations (not members of a gdg). If sorting already, you'll certainly get a performance boost against the existing method.

Your VSAM file is in key order of the first 10 bytes? Is it a KSDS with that key, or, to put it another way, does it have duplicates of the 10-byte key you want.

Do you have headers/trailers on your flat file? If not you might (probably) not know which of the generations your extracted non-matches come from. If you do, hopefully you have a business date you can attach to the records so you know which generation it comes from.

If you don't have anything to tell you where it came from (reliably) then you might be looking at individual jobs for each generation of the dataset.
Then maybe you don't need the sort (depending on the order of the individual file) and you can look at using your original.

Of course, all of the answers should be in the spec. If you need more help, we need more answers.

SORT is not JCL. SORT is a program. All programs run in batch require JCL. What makes a piece of JCL a SORT is the program/procedure executed and the control cards supplied to it. The control cards are the most important thing you need to know, so check the forums and your sort manuals. For the JCL itself, get hold of something that works at your site, you won't have to change it much, probably.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
No new posts COMPARE command sivatechdrive TSO/ISPF 7 Fri Sep 16, 2016 4:31 pm
This topic is locked: you cannot edit posts or make replies. Sort card to replace text using cross... Susanta SYNCSORT 32 Tue Sep 13, 2016 4:17 pm


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