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 

Create multiple output entries for each input entry

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


Joined: 07 Sep 2017
Posts: 3
Topics: 2

PostPosted: Sun Dec 03, 2017 9:33 pm    Post subject: Create multiple output entries for each input entry Reply with quote

Hello,
Is anyone here have an idea how to create multiple output entries for each input entry?

For example I have the following records in the input file:
Code:

RECORD1 10 20 30 40
RECORD2 40 30 50 10
RECORD3 05 20 30 40

The output should be:
Code:

RECORD1 10
RECORD1 20
RECORD1 30
RECORD1 40
RECORD2 40
RECORD2 30
RECORD2 50
RECORD2 10
RECORD3 05
RECORD3 20
RECORD3 30
RECORD3 40

I couldn't find any resource that could help with this requirement.. any DFSORT / ICETOOL or REXX trick?


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


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

PostPosted: Sun Dec 03, 2017 11:44 pm    Post subject: Reply with quote

chmscrbbr,

Unless this is a trick question it is quite simple. You can use RESIZE or OUTFIL build with "/" and you will get the desired results.

Here is an untested DFSORT JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL                       
//TOOLMSG  DD SYSOUT=*                             
//DFSMSG   DD SYSOUT=*                             
//IN       DD *                                   
RECORD1 10 20 30 40                               
RECORD2 40 30 50 10                               
RECORD3 05 20 30 40                               
//OUT      DD SYSOUT=*                             
//TOOLIN   DD *                                   
  RESIZE FROM(IN) TO(OUT) TOLEN(10) USING(CTL1)   
//CTL1CNTL DD *                                   
  INREC BUILD=(1,8,09,02,                         
               1,8,12,02,                         
               1,8,15,02,                         
               1,8,18,02)                         
/*


OUTFIL BUILD
Code:
                                                 
//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD *                                   
RECORD1 10 20 30 40                               
RECORD2 40 30 50 10                               
RECORD3 05 20 30 40                               
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *                                   
  OPTION COPY                                     
  OUTFIL BUILD=(1,8,09,02,/,                       
                1,8,12,02,/,                       
                1,8,15,02,/,                       
                1,8,18,02)                         
/*

_________________
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
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