MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Easy-Trieve logic coding help
Goto page Previous  1, 2
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
mkelley7
Beginner


Joined: 21 Sep 2005
Posts: 13
Topics: 1

PostPosted: Wed Oct 05, 2005 12:47 am    Post subject: Reply with quote

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                       
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Wed Oct 05, 2005 2:00 am    Post subject: Reply with quote

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                                                       
/*                                                                 


Hope this helps,

Thanks,
Phantom
Back to top
View user's profile Send private message
mkelley7
Beginner


Joined: 21 Sep 2005
Posts: 13
Topics: 1

PostPosted: Wed Oct 05, 2005 8:53 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12366
Topics: 75
Location: San Jose

PostPosted: Wed Oct 05, 2005 9:11 am    Post subject: Reply with quote

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

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mkelley7
Beginner


Joined: 21 Sep 2005
Posts: 13
Topics: 1

PostPosted: Wed Oct 05, 2005 9:58 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group