IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to combine records using sort/icetool


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 2455
Location: Hampshire, UK

PostPosted: Sat Apr 14, 2012 11:03 pm
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Apr 15, 2012 12:16 am
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
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: 2455
Location: Hampshire, UK

PostPosted: Sun Apr 15, 2012 3:55 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top