MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

concatanating

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
kishorebodipati
Beginner


Joined: 08 Apr 2004
Posts: 15
Topics: 9
Location: Chennai

PostPosted: Thu Apr 22, 2004 12:01 am    Post subject: concatanating Reply with quote

Dear all,

How can we Concatenate variable length record datasets thru JCL

Thanks,
Kishore
Back to top
View user's profile Send private message Send e-mail
kishorebodipati
Beginner


Joined: 08 Apr 2004
Posts: 15
Topics: 9
Location: Chennai

PostPosted: Thu Apr 22, 2004 1:35 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Meg
Beginner


Joined: 08 Jul 2003
Posts: 44
Topics: 16

PostPosted: Thu Apr 22, 2004 5:30 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Apr 22, 2004 5:37 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
kishorebodipati
Beginner


Joined: 08 Apr 2004
Posts: 15
Topics: 9
Location: Chennai

PostPosted: Thu Apr 22, 2004 5:59 am    Post subject: Reply with quote

Thanks Kolusu....... Megana pls update this.........

Thanks,
kishore
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Apr 22, 2004 10:05 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
vjpilp
Beginner


Joined: 01 May 2004
Posts: 8
Topics: 2

PostPosted: Sat May 01, 2004 2:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sat May 01, 2004 5:04 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
vjpilp
Beginner


Joined: 01 May 2004
Posts: 8
Topics: 2

PostPosted: Fri May 14, 2004 2:34 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group