View previous topic :: View next topic |
Author |
Message |
kishorebodipati Beginner
Joined: 08 Apr 2004 Posts: 15 Topics: 9 Location: Chennai
|
Posted: Thu Apr 22, 2004 12:01 am Post subject: concatanating |
|
|
Dear all,
How can we Concatenate variable length record datasets thru JCL
Thanks,
Kishore |
|
Back to top |
|
|
kishorebodipati Beginner
Joined: 08 Apr 2004 Posts: 15 Topics: 9 Location: Chennai
|
Posted: Thu Apr 22, 2004 1:35 am Post subject: |
|
|
Hi Ravi,
Is it possible to concatenate 3 different datasets with different LRECL thru JCL.If so how? This is interview question.
Regards,
kishore. |
|
Back to top |
|
|
Meg Beginner
Joined: 08 Jul 2003 Posts: 44 Topics: 16
|
Posted: Thu Apr 22, 2004 5:30 am Post subject: |
|
|
Hi Kishore,
We can concatenate and merge files with different LRECL (If this is what you meant) using SORT utility. The sorted output file will be a VB file and the LRECL will be the same as that of the file having the maximum LRECL. For e.g, if ipfilea, ipfileb,ipfilec are having the lrecl of 20,40 and 30 respectively the output file will be a VB file having a LRECL of 40. I am not too sure if it is possible to have output file of FB format but I guess it is possible using SORT again.
Thanks,
Megana |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Apr 22, 2004 5:37 am Post subject: |
|
|
kishorebodipati,
To concatenate data sets, omit the ddnames from all the DD statements except the first in the sequence. The data sets are processed in the same sequence as the DD statements defining them.
Concatenated data sets with format-V records can have different logical record lengths as long as the data set with the largest logical record length appears first in the concatenation. (Note that you can state a value equal to the largest logical record length for LRECL on the first DD statement, regardless of what the actual logical record length of this data set is.)
Check this link for Concatenating Data Sets Sequentially
Hope this helps...
Meg: Sort Utility does not allow concatenating files for different Lrecl.
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
kishorebodipati Beginner
Joined: 08 Apr 2004 Posts: 15 Topics: 9 Location: Chennai
|
Posted: Thu Apr 22, 2004 5:59 am Post subject: |
|
|
Thanks Kolusu....... Megana pls update this.........
Thanks,
kishore |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Thu Apr 22, 2004 10:05 am Post subject: |
|
|
Kolusu wrote Quote: | Meg: Sort Utility does not allow concatenating files for different Lrecl. |
True for FB data sets, but not for VB data sets. Here's the details on that from "DFSORT Application Programming Guide":
------------
The following rules apply to concatenated data sets:
...
* With fixed-length records, LRECL must be the same for all data sets. With variable-length records, LRECL can vary, but the first data set must have the largest LRECL.
...
------------ _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
vjpilp Beginner
Joined: 01 May 2004 Posts: 8 Topics: 2
|
Posted: Sat May 01, 2004 2:30 pm Post subject: |
|
|
I am trying to concatenate a dataset of LRECL 80 with a TEMP dataset of LRECL 160 which I finally use to write to a FLAT FILE. The output file however contains NULLS i.e. X'00' after position 80. I have to remove these NULLS and replace them with space. How do I do this?
I tried OUTREC FIELDS=(1,80,1,81:80X) but my output file had all spaces! |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Sat May 01, 2004 5:04 pm Post subject: |
|
|
The OUTREC statement you show is invalid. DFSORT would give you a syntax error:
Code: |
OUTREC FIELDS=(1,80,1,81:80X)
$
ICE007A E SYNTAX ERROR
|
so I don't know what you mean when you say "my output file had all spaces".
If your input file has data in positions 1-80 and you want to pad your output records with spaces to position 160, you can use either of the following OUTREC statements:
Code: |
OUTREC FIELDS=(1,80,160:X)
|
or
Code: |
OUTREC FIELDS=(1,80,81:80X)
|
You would only get all spaces in the output records if positions 1-80 of the input records have all spaces. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
vjpilp Beginner
Joined: 01 May 2004 Posts: 8 Topics: 2
|
Posted: Fri May 14, 2004 2:34 am Post subject: |
|
|
Thanks, I corrected the syntax error in the control card. What I meant by my output file had all spaces was that I did not see the data I expected. Instead it had spaces on each and every record. |
|
Back to top |
|
|
|
|