View previous topic :: View next topic
|
Author |
Message |
sudhanaveenkumar
New User
Joined: 29 Apr 2010 Posts: 28 Location: chennai
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
sudhanaveenkumar
New User
Joined: 29 Apr 2010 Posts: 28 Location: chennai
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
sudhanaveenkumar
New User
Joined: 29 Apr 2010 Posts: 28 Location: chennai
|
|
|
|
Thats spot on.Thanks a lot.
Regards
Naveen |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
sudhanaveenkumar
New User
Joined: 29 Apr 2010 Posts: 28 Location: chennai
|
|
|
|
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 |
|
|
|