Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Change Line advance from LF to CRLF

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
amarjit singh

New User


Joined: 08 Mar 2013
Posts: 30
Location: india

PostPosted: Tue Mar 19, 2013 2:00 am    Post subject: Change Line advance from LF to CRLF
Reply with quote

Hello Experts,

A file is received by email from mainframe. Could you please help me, how to modify the line advance from LF to CRLF ?

regards,
amarjit
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Tue Mar 19, 2013 2:39 am    Post subject:
Reply with quote

Well, as the mainframe (z/OS) does not use LF or CRLF the LF must have been put there by a program in which case get the program changed. If it came from UNIX then get it FTPed as the FTP software will do the conversion for you.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Mar 19, 2013 9:19 am    Post subject:
Reply with quote

Nic has given you a good explanation; but on the other hand, I'm thinking - why do you ask this question; what prompted you to think about LF/CRLF - specially for a file sent by an e-mail (SMTP)?
Back to top
View user's profile Send private message
amarjit singh

New User


Joined: 08 Mar 2013
Posts: 30
Location: india

PostPosted: Tue Mar 19, 2013 6:47 pm    Post subject:
Reply with quote

Anuj Dhawan wrote:
Nic has given you a good explanation; but on the other hand, I'm thinking - why do you ask this question; what prompted you to think about LF/CRLF - specially for a file sent by an e-mail (SMTP)?


Thank you NIC and Anuj.

there is a mainframe program which prepare jcl, submit job via internal reader, read PS file and send the data as attached text file through TCPIPSMT.

Now the client asking: line advance changed from CRLF to LF. Please modify so that file has CRLF as it was originally created.

i am not sure how to approach for the above issue. please guide.

thanks,
amarjit.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Tue Mar 19, 2013 7:01 pm    Post subject:
Reply with quote

You need to go to the client and ask them what changed on their end. RFC 2821 is the official statement of what an SMTP message looks like, and it explicitly states that CRLF is used in:
Quote:
2.3.7 Lines

SMTP commands and, unless altered by a service extension, message
data, are transmitted in "lines". Lines consist of zero or more data
characters terminated by the sequence ASCII character "CR" (hex value
0D) followed immediately by ASCII character "LF" (hex value 0A).
This termination sequence is denoted as <CRLF> in this document.
Conforming implementations MUST NOT recognize or generate any other
character or character sequence as a line terminator. Limits MAY be
imposed on line lengths by servers (see section 4.5.3).

In addition, the appearance of "bare" "CR" or "LF" characters in text
(i.e., either without the other) has a long history of causing
problems in mail implementations and applications that use the mail
system as a tool. SMTP client implementations MUST NOT transmit
these characters except when they are intended as line terminators
and then MUST, as indicated above, transmit them only as a <CRLF>
sequence.
and from the wording of this quote, the ONLY way an LF would replace CRLF would be if that were done by the receiving system -- not the SMTP originating system nor any relays along the way.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Mar 19, 2013 7:03 pm    Post subject:
Reply with quote

amarjit singh wrote:
there is a mainframe program which prepare jcl, submit job via internal reader, read PS file and send the data as attached text file through TCPIPSMT.
Pardon my ignorance but I think, TCPIPSMT, is a local program at your shop, which might mean anything, however, I'll assume it's a program used to send an e-mail from zOS.

Second, where do you send the data - Unix Box, a Win Base System or..?

I'll assume - it's win base system because UNIX only needs LF , it is Windows which needs both CR and LF. Is that correct?

Well - made all those assumptions but you'll be surprised to know that if they are true, you're entitled to follow what Nic has said at first place.
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Tue Mar 19, 2013 7:13 pm    Post subject:
Reply with quote

As an experiment, try sending the email to yourself. Open it in Windows something and see if it looks ok.

If it looks ok in notepad, it has cr/lf. If it only looks right in wordpad, then it's probably only cr.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Tue Mar 19, 2013 7:18 pm    Post subject:
Reply with quote

I assumed TCPIPSMT is the SMTP started task that z/OS runs via TCP/IP. If it is something else, however, then the question becomes what is your site using to send emails?
Back to top
View user's profile Send private message
amarjit singh

New User


Joined: 08 Mar 2013
Posts: 30
Location: india

PostPosted: Tue Mar 19, 2013 8:59 pm    Post subject:
Reply with quote

Anuj Dhawan wrote:
amarjit singh wrote:
there is a mainframe program which prepare jcl, submit job via internal reader, read PS file and send the data as attached text file through TCPIPSMT.
Pardon my ignorance but I think, TCPIPSMT, is a local program at your shop, which might mean anything, however, I'll assume it's a program used to send an e-mail from zOS.

Second, where do you send the data - Unix Box, a Win Base System or..?

I'll assume - it's win base system because UNIX only needs LF , it is Windows which needs both CR and LF. Is that correct?

Well - made all those assumptions but you'll be surprised to know that if they are true, you're entitled to follow what Nic has said at first place.



thank you all for your respective responses.

The requirement is to change the LF to CRLF.

Not sure what the problem actually is. Fact is that a Job is generating another job via INTRDR which create the SMTP input which is a sequential dataset having fixed record length. TCPIPSMT is a started task running on the mainframe that sends the emails via TCPIP.

As Robert said, the problem is when it is extracted from the email on the addressee's side. This is where a CR LF issue could be corrected.
But i am unable to get to the point of problem and how to rectify it.

regards.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Tue Mar 19, 2013 9:07 pm    Post subject:
Reply with quote

Are you using an attachment?
If yes, what kind of attachment -- MIME or plain text or something else?

SMTP will transmit EBCDIC text data to a Windows / Unix system and convert the EBCDIC text to ASCII text; the CRLF is automatically appended to the records by SMTP (as long as the EBCDIC record length does not exceed the 998 maximum allowed by RFC 2821). And as long as your site is using standard SMTP, then the transmitted file will have CRLF and if that is not what your client is receiving then you need to look at the receiving system and subsequent processing to find the issue.

You may have to get your site support group to put a network sniffer on the line to trace the data coming from the mainframe; if there is X'0D0A' in the data then you've got CRLF and the problem would be isolated to the receiving system and any subsequent processing being done.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Mar 19, 2013 9:44 pm    Post subject:
Reply with quote

Quote:
I assumed TCPIPSMT is the SMTP started task that z/OS runs via TCP/IP.
Thanks TANSTAAFL ..err...'Donald Knuth'...err Rob..hff..Bob! Did I leave any of your nick? icon_smile.gif

Thanks Robert... icon_redface.gif
Back to top
View user's profile Send private message
amarjit singh

New User


Joined: 08 Mar 2013
Posts: 30
Location: india

PostPosted: Wed Mar 20, 2013 12:16 pm    Post subject:
Reply with quote

Robert Sample wrote:
Are you using an attachment?
If yes, what kind of attachment -- MIME or plain text or something else?

SMTP will transmit EBCDIC text data to a Windows / Unix system and convert the EBCDIC text to ASCII text; the CRLF is automatically appended to the records by SMTP (as long as the EBCDIC record length does not exceed the 998 maximum allowed by RFC 2821). And as long as your site is using standard SMTP, then the transmitted file will have CRLF and if that is not what your client is receiving then you need to look at the receiving system and subsequent processing to find the issue.

You may have to get your site support group to put a network sniffer on the line to trace the data coming from the mainframe; if there is X'0D0A' in the data then you've got CRLF and the problem would be isolated to the receiving system and any subsequent processing being done.




Thank you all.
The issue got resolved. I informed the same to the vendor and it was corrected from their side after consulting with user. Thank you everyone for the quick responses which helped to clear the doubt. Regards.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Mar 20, 2013 1:18 pm    Post subject:
Reply with quote

So we've invested a good amount of time for an issue, which was nonexistent, at your end... icon_lol.gif

Nonetheless, glad to hear that you got it working! icon_smile.gif
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Wed Mar 20, 2013 8:21 pm    Post subject:
Reply with quote

I would like to ask that you get the resolution from the client/vendor and post it here. What was done to fix the issue?

The next person reading this would be grateful, I'm sure.
Back to top
View user's profile Send private message
amarjit singh

New User


Joined: 08 Mar 2013
Posts: 30
Location: india

PostPosted: Wed Mar 20, 2013 8:43 pm    Post subject:
Reply with quote

Ed Goodman wrote:
I would like to ask that you get the resolution from the client/vendor and post it here. What was done to fix the issue?

The next person reading this would be grateful, I'm sure.


Hi,
even i would love to know the solution..
scenario: it was an incident ticket raised by the user. i summerized all the above suggestion given by respective forum members and replied to user. Taking suggestion into account, user directly had a discussion with 3rd party vendor and informed us to close the ticket as the issue has been resolved. if i get a chance to know the solution from user (which i doubt), i wiil post here for future reference. thanks.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts How to change dataset attributes of m... ignich7 JCL & VSAM 3 Thu Jul 21, 2016 9:17 pm
No new posts GDG vsersion number change Raghu navaikulam JCL & VSAM 5 Fri May 27, 2016 4:49 pm
No new posts Change Data Capture Ron Klop DFSORT/ICETOOL 14 Fri Apr 15, 2016 2:56 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us