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

Concatenate files with different lengths?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Michael Mays

New User


Joined: 05 May 2010
Posts: 6
Location: Farmington Hills, MI

PostPosted: Wed May 05, 2010 9:18 pm
Reply with quote

I am composing an Email with several attached files of different record lengths. We are attempting to use IEBGENER to concatenate the files then deliver the output to SMTP. Another post mentions that IEBGENER copy functions are intercepted by DFSORT(or SYNCSORT), which generates:
WER171A CONCAT DS, LRECLS NE OR RECFMS DIFF
SYNCSORT COPY FEATURE CALLED - RC = 12

Is there an easy way to do this? or do I need to manually(COBOL) reformat each file to a common LRECL?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed May 05, 2010 9:27 pm
Reply with quote

If the files are FIXED length, you must reformat all to match the length of the longest LRECL. If the files are VARIABLE length, you are not required to do so. Assuming, based upon your post, that they are fixed length you must do the reformat with a utility or a program.
Back to top
View user's profile Send private message
Corey Hardy

New User


Joined: 14 Apr 2010
Posts: 9
Location: Virginia

PostPosted: Thu May 06, 2010 12:38 am
Reply with quote

Assuming that the LRECL of your longest file is 200 and the LRECL of input file #1 is 80; the sort below will expand the LRECL of input file #1 from 80 to 200.

Code:

//SRTFIL1  EXEC PGM=SORT                           
//SYSIN    DD *                                                 
 SORT FIELDS=COPY                                               
 OUTFIL FILES=1,                                               
       OUTREC=(001:001,080,                                   
               200:C' ')                                       
//SORTIN   DD DSN=INPUT.FILE,DISP=SHR                           
//SORTOF1  DD DSN=OTPUT.FILE,DISP=(NEW,CATLG,DELETE)
Back to top
View user's profile Send private message
Michael Mays

New User


Joined: 05 May 2010
Posts: 6
Location: Farmington Hills, MI

PostPosted: Thu May 06, 2010 6:55 pm
Reply with quote

Thanks Corey! I asked for "simple", that's what you gave me, and it worked perfectly. Now just got to figure out why SMTP won't send files with LRECL > 80 bytes... but that will probably be another post.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu May 06, 2010 8:52 pm
Reply with quote

SMTP quite happily handles files with records up to 998 bytes in length; if you aren't getting files with more than 80 bytes to send, it is something you are doing at your site. Of course, you cannot use DD * for records with lengths greater than 80, but I've sent many a file with longer record lengths by storing my commands and data into a PDS of the desired record length and using that as input.
Back to top
View user's profile Send private message
Michael Mays

New User


Joined: 05 May 2010
Posts: 6
Location: Farmington Hills, MI

PostPosted: Thu May 06, 2010 10:25 pm
Reply with quote

Thanks Robert. I guess that explains why my attachments of LRECL=3000 won't go.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu May 06, 2010 11:24 pm
Reply with quote

LOL -- sure does. RFC 2821 and 2822 describe SMTP in all its gory details. If you want to know more about them, Google either. The actual limit is 1000 bytes per line but the last two bytes are reserved for carriage return and line feed.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top