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 

Using restart

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
naveen_summary
Beginner


Joined: 12 Feb 2007
Posts: 26
Topics: 13

PostPosted: Wed Feb 21, 2007 5:17 am    Post subject: Using restart Reply with quote

Hello Gurus

I need to restart the count whenever there is a change in 2 different non-consecutive columns like in example below.

How do I handle this? Because if I give restart on more than one feild it fails with error. I have seen the synatx of restart is limited to =(p,m) and also(%nn). Can you help me out on this.


Quote:
SORT FROM(IN) TO(T1) USING(CTL1)
SELECT FROM(T1) TO(OUT) ON(1,1,CH) ON(324,2,CH) LAST

//CTL1CNTL DD *
OPTION EQUALS
SORT FIELDS=(1,1,CH,A,
324,2,CH,A)
OUTREC OVERLAY=(12795:SEQNUM,3,ZD,RESTART=(1,1,324,2)) /*Error here */
/*


Regards.
Back to top
View user's profile Send private message
naveen_summary
Beginner


Joined: 12 Feb 2007
Posts: 26
Topics: 13

PostPosted: Wed Feb 21, 2007 6:27 am    Post subject: Reply with quote

Gurus,
I have resolved the problem by re-arranging my sort filelds consecutively and then using a restart on this.
Please let me know if there is a easier solution

Quote:

//TOOLIN DD *
COPY FROM(IN) TO(T1) USING(CTL1)
SORT FROM(T1) TO(T2) USING(CTL2)
SELECT FROM(T2) TO(T3) ON(1,3,CH) LAST
COPY FROM(T3) TO(OUT) USING(CTL3)
//CTL1CNTL DD *
OUTREC FIELDS=(1,1,324,2,1,12794)
/*
//CTL2CNTL DD *
OPTION EQUALS
SORT FIELDS=(1,3,CH,A)
OUTREC OVERLAY=(12798:SEQNUM,3,ZD,RESTART=(1,3))
/*
//CTL3CNTL DD *
OUTREC FIELDS=(4,12797)
/*


Regards,
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Feb 21, 2007 9:08 am    Post subject: Reply with quote

naveen_summary,

You cannot use RESTART parm on non-consecutive fields. You can use the INREC statement to put the 2 fields together and generate the seqnum on OUTREC. If your intention is to get the last record then a simple select option will do it. You can have multiple ON parms on the SELECT statement.

Code:

//TOOLIN DD *
  SELECT FROM(IN) TO(OUT) ON(1,1,CH) ON(324,2,CH) LAST
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
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