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
 

 

fields truncated in csv file
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Wed May 13, 2015 10:45 pm    Post subject: fields truncated in csv file
Reply with quote

Hi,
I have about 17 fields with comma separated format dataset and I am using IEBGENER to send mail with SMTP. Few Fields has width of maximum 500 that was generated using SAS. In the output CSV excel file only 13 fields are coming. The last 4 fields are missing.May I know why is it happening like that....?

The dataset record length is 1202.
Back to top
View user's profile Send private message

RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Wed May 13, 2015 11:06 pm    Post subject: Reply to: fields truncated in csv file
Reply with quote

Quote:
Few Fields has width of maximum 500


I assume there are more than 1 field with maximum length of 500 and the LRECL of dataset is just over 1200.

Don't you think that the data may be getting truncated?

Please give more detail
.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Wed May 13, 2015 11:16 pm    Post subject: Re: Reply to: fields truncated in csv file
Reply with quote

RahulG31 wrote:
Quote:
Few Fields has width of maximum 500


I assume there are more than 1 field with maximum length of 500 and the LRECL of dataset is just over 1200.

Don't you think that the data may be getting truncated?

Please give more detail
.



Actually out of the 17 fields one field has 540 and second one have 480, the third one has 120, remaining other fields has 10 and 20 length and all those sum upto 1202 record length. The data is not truncated in the dataset.

The dataset has all the 17 fields in correct format and length.When I use this dataset(csv formatted) and send mail using SMTP. the excl csv attachement has last four fields missing.that is, only 13 fields are coming in excel wheareas the dataet has all the 17 fields in it.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed May 13, 2015 11:20 pm    Post subject: Reply to: fields truncated in csv file
Reply with quote

Can you show a truncated sample of the records on the Mainframe, and also for the same records on the server?
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Wed May 13, 2015 11:34 pm    Post subject: Re: Reply to: fields truncated in csv file
Reply with quote

Bill Woodger wrote:
Can you show a truncated sample of the records on the Mainframe, and also for the same records on the server?


The data is not truncated on the mainframe.

say for example i have below dataset in mainframe:

A,B1 IN B2 IN B3 IN B4 IN, B4 OUT +,D1 D2 D3 D4 ,E ,F,G,H

when I send the above dataset using SMTP mail,i get the below in EXCEL.CSV

col1 col2 col3 col4
Row1 A B1IN B2 IN B3 IN B4 IN D1 D2 D3 D4 E

here F,G,H is not present in excel but it is there in dataset in mainframe.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Wed May 13, 2015 11:35 pm    Post subject: Reply to: fields truncated in csv file
Reply with quote

I am a little puzzled. 540+480+120=1140

So, now you have other 14 fields of 10 and 20 lengths that you are adjusting in just 62 bytes?

Moreover, there will be 16 ',' in the file. So, that makes you to adjust 14 fields in 46 bytes now.

Did you account for the ',' ?

I assume you did everything. So, as Bill says, show us some sample data and the job details
.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Wed May 13, 2015 11:59 pm    Post subject:
Reply with quote

here is the length of each field below:

A - 3
C - 1
B - 8
C - 1
D - 3
C - 1
E - 8
C - 1
F - 540
C - 1
G - 120
C - 1
H - 3
C - 1
I - 4
C - 1
J - 1
C - 1
K - 480
C - 1
L - 4
C - 1
M - 4
C - 1
N - 1
C - 1
O - 4
C - 1
P - 4

In the aboce C means for COMMA.... All other letters corresponds to the field and their length....In this I get all the field values properly in the mainframe but it is sent mail, The excel.csv file has fields only upto K field and fields L,M,N,O,P are not present in the excel sheet.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Thu May 14, 2015 12:15 am    Post subject:
Reply with quote

You said 17 fields but you show only 15.
You said 4 were missing and now you tell 5 are missing.
You said 13 were coming in the excel and now you intend to say only 10 are there.
You said 10 and 20 length and now you show a single digit length.

And you are NOT showing the job yet.

Please show the Job.

.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Thu May 14, 2015 12:19 am    Post subject: Reply to: fields truncated in csv file
Reply with quote

AND the sum of the above 15 fields + ','s = 1201

So, there can't be more than 15 fields. You better need to clarify.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Thu May 14, 2015 12:26 am    Post subject:
Reply with quote

And please use Code tags to preserve accurate spacing when pasting.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Thu May 14, 2015 12:28 am    Post subject: Re: Reply to: fields truncated in csv file
Reply with quote

RahulG31 wrote:
AND the sum of the above 15 fields + ','s = 1201

So, there can't be more than 15 fields. You better need to clarify.



yes it is fixed....
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Thu May 14, 2015 12:30 am    Post subject: Reply to: fields truncated in csv file
Reply with quote

'What' is 'Fixed' ?

.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Thu May 14, 2015 12:34 am    Post subject:
Reply with quote

RahulG31 wrote:
You said 17 fields but you show only 15.
You said 4 were missing and now you tell 5 are missing.
You said 13 were coming in the excel and now you intend to say only 10 are there.
You said 10 and 20 length and now you show a single digit length.

And you are NOT showing the job yet.

Please show the Job.

.


job is just the mail job using IEBGENER. And sorry for telling the number wrongly i dint look at my notes properly. the one which i explained was the right one.As i dont have access to mainframe i couldnt give you the correct info the first time very sorry for that.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Thu May 14, 2015 12:39 am    Post subject: Re: Reply to: fields truncated in csv file
Reply with quote

RahulG31 wrote:
'What' is 'Fixed' ?

.



there will be 15 fields and its length is fixed in the data set.
please see the below link which has SAS code that generates the dataset, which is sent as CSV formatted file.

[URL] http://www.ibmmainframes.com/viewtopic.php?t=64039 [/URL]
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Thu May 14, 2015 1:08 am    Post subject: Reply to: fields truncated in csv file
Reply with quote

So, it seems that your file is working only till record length 1000. Does it remind me of something? Is there a limit in SMTP for record length (which is 1000)?

Please check if you are facing truncation with the last field in the CSV which should be the 480 byte field.

And also, show your SMTP steps when you have access to Mainframe.

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

Global Moderator


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

PostPosted: Thu May 14, 2015 2:01 am    Post subject:
Reply with quote

SMTP has a record limit of 1000 bytes including the CR/LF at the end of the line. This is listed in the RFC for SMTP, hence you are not going to be changing the 1000 limit on a line. So your choices are:
1. truncate your data down to 1000 (actually 998) bytes
2. use MIME to send longer records
3. use some other method besides SMTP to send the data
4. split your data so the lines are shorter with two lines per record
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Thu May 14, 2015 11:37 am    Post subject:
Reply with quote

So here is my Mail step:

Code:


//SENDMAIL EXEC PGM=IEBGENER,
//             COND=(0,NE)
//SYSIN    DD   DUMMY
//SYSPRINT DD   SYSOUT=*
//SYSUT2   DD   SYSOUT=(B,SMTP)
//SYSUT1   DD   DSN=***.***.CNTRL.EMAIL,DISP=SHR
//         DD   DSN=***.***.****.CNTRLM.RPT,DISP=SHR
//         DD   DSN=***.QUIT.STMT,DISP=SHR



and ***.***.CNTRL.EMAIL contains below :

Code:


HELO ***
MAIL FROM: <***.***@***.COM>
RCPT TO: <***.***@***.COM>
DATA
FROM: <*** TEAM>
TO: < *** TEAM>
SUBJECT: CONTROL-M DOCUMENTATION
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="=_BOUNDS"

--=_BOUNDS
CONTENT-TYPE: TEXT/PLAIN;CHARSET="US-ASCII"

PLEASE FIND THE ATTACHED CONTROL-M DOCUMENT.
THANKS,

--=_BOUNDS
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME="CNTRL-M DOC.CSV"



***.QUIT.STMT contains

Code:


.
QUIT



***.***.****.CNTRLM.RPT contains the records of 1202 record length.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Thu May 14, 2015 11:39 am    Post subject:
Reply with quote

Robert Sample wrote:
SMTP has a record limit of 1000 bytes including the CR/LF at the end of the line. This is listed in the RFC for SMTP, hence you are not going to be changing the 1000 limit on a line. So your choices are:
1. truncate your data down to 1000 (actually 998) bytes
2. use MIME to send longer records
3. use some other method besides SMTP to send the data
4. split your data so the lines are shorter with two lines per record



Is there some other method other than SMTP, because I cannot limit the record length and I have used MIME only to send the records I hope, Please see my code I have posted.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Thu May 14, 2015 11:41 am    Post subject: Re: Reply to: fields truncated in csv file
Reply with quote

RahulG31 wrote:
So, it seems that your file is working only till record length 1000. Does it remind me of something? Is there a limit in SMTP for record length (which is 1000)?

Please check if you are facing truncation with the last field in the CSV which should be the 480 byte field.

And also, show your SMTP steps when you have access to Mainframe.

.


I have posted my Mail step codes. Please see it....As Rober sample said I think the records limit is by 1000 so if there is any other any that i could send all the records it would be good as i cannot truncate or drop the records.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Thu May 14, 2015 12:03 pm    Post subject: Reply to: fields truncated in csv file
Reply with quote

if You want to send something in a format different from plain text
using the zOS smpt server You will have to do the conversion Yourself
IEBGENER will NOT do it.

xmitip has an assembler program which will convert a dataset to the MIME format
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 -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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