Thanks, Phantom. That worked great for doing it with sequential files. Trying to do it with a table, however, has stumped a couple of us. When I add those statements I get the following:
Code:
SORT I701 TO I701 USING (CUSTCODE, STYLE)
SORT ZSTYLES TO ZSTYLES USING (PARM-CUSTCODE, PARM-STYLE)
*******B054 NOT A VALID FILE - ZSTYLES
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Wed Oct 05, 2005 2:00 am Post subject:
mkelley7,
I think I figured out the cause of the problem. Check this message - Taken from the Eztrieve manual.
Quote:
Table Definition
A table is a collection of uniform data records that presents unique processing
opportunities. All tables have two parts:
Parts Definitions
Argument - Uniquely identifies a table entry.
Description - Remainder of the table entry.
According to this, the Argument must be Unique. In your case, CUSTCODE is not unique by itself. Custcode together with Style makes it unique. But looking at Kolusu's solution, the SEARCH Keyword uses only Custcode to search the table and that is the reason why you are getting the out of sequence error.
I tried with this logic and it worked fine. I am not good in Eazytrieve, May be Kolusu or someone could fine-tune my code.
To make the Argument Unique, I had to swap the positions of New-Style and Custcode, so that, Custcode immediately comes after Old-Style. I used to Sort to do this.
Code:
//R010 EXEC PGM=SORT
//SORTIN DD *
B AAXXX 91100124
VP5 BBXXX 91100197
AT CCXXX 91100235
DHB DDXXX 91100235
B CCXXX 91100235
B EEXXX 91107516
/*
//SORTOUT DD DSN=&&TEMP1,DISP=(,PASS)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,6,CH,A,34,8,CH,A)
OUTREC FIELDS=(1,6,X,34,8,X,22,6)
/*
//*
//R020 EXEC PGM=EZTPA00
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//I701 DD DSN=YOUR.INPUT.FILE,
// DISP=SHR
//ZSTYLES DD DSN=&&TEMP1,DISP=SHR,VOL=REF=*.R010.SORTOUT
//O701 DD DSN=YOUR.OUTPUT.FILE,DISP=SHR
//SYSIN DD *
FILE I701
OLD701 1 1360 A
CUSTCODE 1 8 A
STYLE 44 6 A
VOIDED 125 1 A
PLANT 237 4 A
CUT 545 12 A OCCURS 3
BRANCH 433 5 A
FILE ZSTYLES TABLE 500
ARG 1 15 A
DESC 17 06 A
FILE O701 FB(0 0)
NEW701 1 1360 A
O-CHNG-STYLE 44 6 A
W-SRCH-ARG W 15 A
W-SRCH-OLD-STYLE W-SRCH-ARG 06 A
FILLER1 W-SRCH-ARG +6 01 A
W-SRCH-CUST-CODE W-SRCH-ARG +7 08 A
W-CHNG-STYLE W 06 A
**********************************************************
* MAINLINE
**********************************************************
JOB INPUT I701
W-SRCH-OLD-STYLE = STYLE
W-SRCH-CUST-CODE = CUSTCODE
W-CHNG-STYLE = STYLE
SEARCH ZSTYLES WITH W-SRCH-ARG GIVING W-CHNG-STYLE
NEW701 = OLD701
IF W-SRCH-OLD-STYLE = STYLE AND W-SRCH-CUST-CODE = CUSTCODE
O-CHNG-STYLE = W-CHNG-STYLE
END-IF
PUT O701
/*
Maybe I am just trying to do the impossible. I was hoping to not pull the jobs instream using sortin. I gave a small sample of the each of the files. The zstyle file would be about 500 records and subject to frequent changes (I don't want to run it through changeman three times a week and the people with access to change the file won't be able to). The file I am changing has about 300,000 records a day and we are looking to change about 20,000 records a day. Is it possible to use a dataset for the zstyle data? Thank you for all of your help, Phantom.
Joined: 26 Nov 2002 Posts: 12366 Topics: 75 Location: San Jose
Posted: Wed Oct 05, 2005 9:11 am Post subject:
Quote:
Maybe I am just trying to do the impossible. I was hoping to not pull the jobs instream using sortin.
Mkelly7,
You got it all wrong. Phantom showed an example using instream data,so that it will be easy to understand here on this forum. But you can replace the instream data with a physical dataset.
Kolusu _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Phantom, the solution you gave works perfectly. Thanks Kolusu for helping me understand the forums here. Reading the problems and solutions entered here has greatly improved my understanding. I wish I would have found this site years ago.
All times are GMT - 5 Hours Goto page Previous1, 2
Page 2 of 2
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum