Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to combine records using sort/icetool

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

New User


Joined: 29 Apr 2010
Posts: 28
Location: chennai

PostPosted: Sat Apr 14, 2012 6:49 pm    Post subject: How to combine records using sort/icetool
Reply with quote

Hi,

My project requirement is like the below

1)I/P file: FB and LRECL=28
Contains records like the below

aaaaa
bbbbbbb
cccccccc
aaaaa
bbbbbbb
cccccccc
aaaaa
bbbbbbb
cccccccc

Each record will have a maximum of first 8 non-blank characters(I.e. a maximum of 8 chars and remaining are blanks)
I want to combine every three successive records into a single record with (2 spaces gap in between while combining) and write to output file


2)O/P should be

aaaaa bbbbbbb cccccccc
aaaaa bbbbbbb cccccccc
aaaaa bbbbbbb cccccccc




Thanks a lot
Naveen
_________________
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1756
Location: UK

PostPosted: Sat Apr 14, 2012 11:03 pm    Post subject:
Reply with quote

the same query passed through here the other week so you obviously saw it as you have been a member for a couple of years. Why did you not search for it? You need the RESIZE operator.
Back to top
View user's profile Send private message
sudhanaveenkumar

New User


Joined: 29 Apr 2010
Posts: 28
Location: chennai

PostPosted: Sat Apr 14, 2012 11:08 pm    Post subject: Reply to: How to combine records using sort/icetool
Reply with quote

Hi Nic,

thaks for the update.

I cant use RESIZE as my input file and output file are of same record length.

Please advise.


Thanks a lot
Naveen
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7309

PostPosted: Sun Apr 15, 2012 12:16 am    Post subject: Reply to: How to combine records using sort/icetool
Reply with quote

With the CTL1CNTL the input can be made into 10 bytes with INREC BUILD and the output into 28 with OUTFIL BUILD.

Code:
//MAKEBIG EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
AAAAA
BBBBBBB
CCCCCCCC
AAAAA
BBBBBBB
CCCCCCCC
AAAAA
BBBBBBB
CCCCCCCC
//OUT1 DD SYSOUT=*
//TOOLIN DD *
  RESIZE FROM(IN1) TO(OUT1) TOLEN(30) USING(CTL1)
//CTL1CNTL DD *
  INREC BUILD=(1,10)
  OUTFIL BUILD=(1,28)


Output is:

Code:
AAAAA     BBBBBBB   CCCCCCCC
AAAAA     BBBBBBB   CCCCCCCC
AAAAA     BBBBBBB   CCCCCCCC
Back to top
View user's profile Send private message
sudhanaveenkumar

New User


Joined: 29 Apr 2010
Posts: 28
Location: chennai

PostPosted: Sun Apr 15, 2012 12:22 am    Post subject: Reply to: How to combine records using sort/icetool
Reply with quote

Thats spot on.Thanks a lot.


Regards
Naveen
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1756
Location: UK

PostPosted: Sun Apr 15, 2012 3:55 pm    Post subject:
Reply with quote

You first say that you cannot use RESIZE and then you say a solution that uses RESIZE is 'spot on'. Make your mind up.
Back to top
View user's profile Send private message
sudhanaveenkumar

New User


Joined: 29 Apr 2010
Posts: 28
Location: chennai

PostPosted: Sun Apr 15, 2012 5:11 pm    Post subject:
Reply with quote

Hi Nic,

Thats because i hadnt known that i could take few bytes of each record(i.e. inrec build= (1,10)) from input file before resizing.

Thats the point i liked in Bill's sample jcl.

Hope you got it.

Thanks a lot.
Naveen
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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us