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 

replicate data until a condition is met using syncsort

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


Joined: 26 Dec 2007
Posts: 4
Topics: 3

PostPosted: Thu Dec 23, 2010 7:36 am    Post subject: replicate data until a condition is met using syncsort Reply with quote

Hi,
i want to reformat the following.
i/p file format:
Code:

abcd pds1 mem1
          mem2
          mem3
cdef pds2 mem4
          mem5
          mem6

o/p:
Code:

abcd pds1 mem1
abcd pds1 mem2
abcd pds1 mem3
cdef pds2 mem4
cdef pds2 mem5
cdef pds2 mem6


the length of the fields are field1(5), field2(45), field(10).

TIA
Back to top
View user's profile Send private message
Brian Wood
Beginner


Joined: 14 Jan 2009
Posts: 37
Topics: 0
Location: USA

PostPosted: Thu Dec 23, 2010 12:02 pm    Post subject: Reply with quote

nithyakothai:

Your posting displays the second and third input records as containing fields starting in position 01 with the data "mem2" and "mem3". In your first input record the field containing "mem1" begins at a different position (presuambly your third field, which appears to begin at position 51). Is this true?
If the records that contain "mem#" all begin at the same position within each record, then you should be able to use INREC/OUTREC IFTHEN WHEN=GROUP processing to handle this processing (see pages 2.165 through 2.171 in the current SyncSort for z/OS 1.3 Programmer's Guide). You need to better define what constitutes a GROUP of records (ie: is it always a group of 3 detail records, or is there some criteria that you could specify as your BEGIN=(conditions)).

Please reply if you require further assistance.
_________________
Brian Wood
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
Brian Wood
Beginner


Joined: 14 Jan 2009
Posts: 37
Topics: 0
Location: USA

PostPosted: Thu Dec 23, 2010 2:26 pm    Post subject: Reply with quote

nithyakothai:

I see that someone has reformatted your post so that the "mem#" records now all appear at the same position in the record.
In order to use INREC/OUTREC IFTHEN WHEN=GROUP processing you need to be able to supply information regarding the logical test to be used to specify that a record starts a group (see page 2.165 in the SyncSort for z/OS 1.3 Programmer's Guide). How do you define this criteria?
_________________
Brian Wood
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
nithyakothai
Beginner


Joined: 26 Dec 2007
Posts: 4
Topics: 3

PostPosted: Thu Dec 23, 2010 10:11 pm    Post subject: Reply with quote

Until next value arrives in first field we can consider them to a be a same group of data
Back to top
View user's profile Send private message
Brian Wood
Beginner


Joined: 14 Jan 2009
Posts: 37
Topics: 0
Location: USA

PostPosted: Tue Dec 28, 2010 3:49 pm    Post subject: Reply with quote

nithyakothai:

Using your simple example I was able to produce the desired results using these control statements (requires SyncSort for z/OS 1.3.2):

Code:
   INREC IFTHEN=(WHEN=GROUP,
                 BEGIN=(01,01,CH,NE,X'40'),PUSH=(01:01,10))
   SORT FIELDS=COPY

Your record description idicates that the first field ('abcd') begins at position 1 for a length of 5, the second field ('pds#') begins at position 6 for a length of 45, and the third field ('mem#') begins at position 51 for a length of 10. Using this record layout the code can be modified as follows:

Code:
   INREC IFTHEN=(WHEN=GROUP,
                 BEGIN=(01,01,CH,NE,X'40'),PUSH=(01:01,50))
   SORT FIELDS=COPY


Hope this helps!
_________________
Brian Wood
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
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