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

Inserting variable length into output file


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

New User


Joined: 20 Sep 2022
Posts: 3
Location: USA

PostPosted: Tue Sep 20, 2022 9:20 pm
Reply with quote

Hi,

I have a requirement:

Input file has email id: for ex.,

abcd@gmail.com
abedfre@gmail.com
jdfhdjfhnjdhffdhf@gmail.com
abc@gmail.com

My output should be :

insert into mail (SEQ ID, MAIL, EMAILID, TEMPLATEID)
values (1234, (mail.nextval), '<email id from input file>', 5376);


In my output everything is unchnanged except email id. Here i need to insert the email id into the output string. I have to do this in jcl. But i am getting spaces after email id as i am taking email address from input file as fixed lenght.

Is there any solution to fit the exact email address into the output?

Please help me on this.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1246
Location: Bamberg, Germany

PostPosted: Tue Sep 20, 2022 9:53 pm
Reply with quote

You can use any programming language you like, but not JCL or VSAM. I would think of Sort for example.

What have you tried yourself so far?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2019
Location: USA

PostPosted: Tue Sep 20, 2022 10:14 pm
Reply with quote

1. Please, learn how to post your samples using the Code button:

kanipriya wrote:
Hi,

I have a requirement:

Input file has email id: for ex.,

Code:
abcd@gmail.com
abedfre@gmail.com
jdfhdjfhnjdhffdhf@gmail.com
abc@gmail.com


My output should be :

Code:
insert into mail (SEQ ID, MAIL, EMAILID, TEMPLATEID)
 values (1234, (mail.nextval), '<email id from input file>', 5376);


In my output everything is unchnanged except email id. Here i need to insert the email id into the output string. I have to do this in jcl. But i am getting spaces after email id as i am taking email address from input file as fixed lenght.

Is there any solution to fit the exact email address into the output?

Please help me on this.


2. There is absolutely no way to do it in JCL. Period.

3. The "insertion" of a record can be done in VSAM using existing VSAM files (but not using sequential files as you are dealing with). This is absolutely different issue from what you need to achieve. Period.

4. Please, choose any other of 100500 available tools you are familiar with? If there is any tool familiar to you, the job can be done in minutes.
If no such tool is available. I suggest you to start RTFM.
Hint: start reading about SORT tools (DFSORT, or SYNCSORT)
You can also use REXX, or COBOL, or C/C++, or Java-Python-etc. or many-many other tools you are able to use.

5. Your topic is titled "Inserting variable length into output file"
FYI: "variable length" is a numeric value.
It is not clear, how do you need to "insert" any numeric value "into output file"?
The content of your topic doesn't match its title.
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top