Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Repeat part of record multiple times

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Learncoholic

New User


Joined: 20 Sep 2007
Posts: 88
Location: India

PostPosted: Tue Aug 29, 2017 11:33 am    Post subject: Repeat part of record multiple times
Reply with quote

Hi,
I have a file with layout as:
Code:
AAA 123
BBB 345
CCC 4579
DDD 4578


I would like the O/P as:
Code:
AAA 123 AAA(Repeated 5 times)
BBB 345 BBB(Repeated 5 times)
CCC 4579 CCC(Repeated 5 times)
DDD 4578 DDD9Repeated 5 times)


Can you please suggest me?

Thanks
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1922
Location: UK

PostPosted: Tue Aug 29, 2017 2:21 pm    Post subject:
Reply with quote

PARSE and BUILD
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1817
Location: NY,USA

PostPosted: Tue Aug 29, 2017 10:30 pm    Post subject:
Reply with quote

I know its not a good practice but an option if it is just limits to 5.
Code:
//STEP1   EXEC PGM=SORT                                                 
//INA      DD *                                                         
AAA 123                                                                 
BBB 345                                                                 
CCC 4579                                                               
DDD 4578                                                               
//INB      DD *                                                         
AAA 123                                                                 
BBB 345                                                                 
CCC 4579                                                               
DDD 4578                                                               
//SORTOUT  DD SYSOUT=*                                                 
//SYSOUT  DD SYSOUT=*                                                   
//SYSIN DD *                                                           
   OPTION COPY                                                         
   JOINKEYS F1=INA,FIELDS=(1,3,A),SORTED,NOSEQCK                       
   JOINKEYS F2=INB,FIELDS=(1,3,A),SORTED,NOSEQCK                       
   REFORMAT FIELDS=(F1:1,8,F1:4,1,F1:1,4,F1:1,4,F1:1,4,F1:1,4,F1:1,4)   

Output:
Code:
********************************* TOP OF DATA **********************************
AAA 123  AAA AAA AAA AAA AAA                                                   
BBB 345  BBB BBB BBB BBB BBB                                                   
CCC 4579 CCC CCC CCC CCC CCC                                                   
DDD 4578 DDD DDD DDD DDD DDD                                                   
******************************** BOTTOM OF DATA ********************************
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 408
Location: USA

PostPosted: Tue Aug 29, 2017 11:35 pm    Post subject: Reply to: Repeat part of record multiple times
Reply with quote

I do not understand what is so complex about the requirement. It seems that it can be achieved by only doing a build as simple as:
Code:
BUILD=(1,9,1,4,1,4,1,4,1,4,1,4)


Learncoholic, please explain more about the complexity of the task.

.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1817
Location: NY,USA

PostPosted: Wed Aug 30, 2017 12:54 am    Post subject:
Reply with quote

Haha, RahulG31, you spotted rightly. I don't know, why I had to think too much on that.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Squeeze record left so that zeroes ar... Vignesh Sid SYNCSORT 5 Fri Nov 10, 2017 1:40 pm
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts Updating multiple counts in trailer!! Vignesh Sid SYNCSORT 4 Mon Nov 06, 2017 1:04 pm
No new posts Selecting a row from multiple tables! Vignesh Sid DB2 2 Thu Oct 26, 2017 6:09 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us