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

Need to copy different length input string to output file


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ruchi.jain

New User


Joined: 17 Sep 2007
Posts: 17
Location: Pune

PostPosted: Mon Sep 01, 2008 7:15 pm
Reply with quote

Hi,
I have one input file which contains 2 data i.e.
ABDC
ABC

i want in my output file as:
ABCD.LIST
ABC.LIST

please help me in getting this.
I tried using Delimiter by Size/Space but not getting the output as expected.
Appreciate your help.

Thanks,
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Sep 01, 2008 8:09 pm
Reply with quote

Ruchi Jain,

1. you are going from abdc to abcd.list? assume that is a typo.

what do your ws variables look like
and
what is your string statement
and
what output are you getting?

with that info, many here will be able to help.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Sep 02, 2008 1:17 am
Reply with quote

Hello Ruchi Jain and welcome to the forums,

Quote:
Appreciate your help.
You need to post the requested info. . .
Back to top
View user's profile Send private message
ruchi.jain

New User


Joined: 17 Sep 2007
Posts: 17
Location: Pune

PostPosted: Tue Sep 02, 2008 9:39 am
Reply with quote

Dick,
no that is not the typo error.

My input file contains 2 values
ABCD
ABC

i want the output to be:
ABCD.LIST
ABC.LIST

i want to append the '.LIST' word after the value of input file.
I used Delimited by space then i got the output as:
ABCD.LIST
ABC.LIST'

If i use Delimited by size then the output is
ABCD.LIST
ABC .LIST

Can you help me in getting the output mentioned above.
Please specify which function to use.
Back to top
View user's profile Send private message
Krishna Velamur

New User


Joined: 22 Aug 2008
Posts: 22
Location: Hyderabad

PostPosted: Tue Sep 02, 2008 10:08 am
Reply with quote

Hi,
I guess you must be using a variable of length 4 (i.e PIC X(4)).

Thats why when you use Delimited by size you are getting the result as ABC .LIST

You need to use Delimited by space to get the expected result.
Back to top
View user's profile Send private message
ruchi.jain

New User


Joined: 17 Sep 2007
Posts: 17
Location: Pune

PostPosted: Tue Sep 02, 2008 10:11 am
Reply with quote

Actually the length of the variable which contain the inpur file data is X(04) but there are some value with x(03).

So can you let me know the logic so that i can use that length x(04) for both but after my program runs it will give the output as:

for x(04) ---> ABCD.LIST
for x(03) ----> ABC.LIST
Back to top
View user's profile Send private message
ruchi.jain

New User


Joined: 17 Sep 2007
Posts: 17
Location: Pune

PostPosted: Tue Sep 02, 2008 10:19 am
Reply with quote

I want the output as
ABCD.LIST
ABC.LIST

not like ABC .LISt or ABC.LIST'
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Tue Sep 02, 2008 10:43 am
Reply with quote

Hi,
ruchi.jain wrote:
no that is not the typo error.
I do not agree here, please check the posted inputs in your posts, they differ.

Again, from your last post
Code:
not like ABC .LISt
I understand you don't need "t" but why would you say so..when you are trying to "append" a capital "T".. icon_confused.gif

And in this
Code:
or ABC.LIST'
what's your point - you don't want apostrophe to appear in the output..why would it come when only "LIST" is appended.. icon_confused.gif

Should I assume this
Code:
ABCD.LIST
ABC.LIST
is expected ouput when input is
Code:
ABCD
ABC
& first record is ABCD & not ABDC as posted in your very first post.

If above is not true, Please post back the input & expected output, please use BBCode while posting them.
Back to top
View user's profile Send private message
ruchi.jain

New User


Joined: 17 Sep 2007
Posts: 17
Location: Pune

PostPosted: Tue Sep 02, 2008 10:48 am
Reply with quote

I aplogies for the mistakes. Yes whatever you understand is correct.

I want the output as
ABCD.LIST
ABC.LIST

where as the input is:
ABCD
ABC

Thanks,
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Sep 02, 2008 1:00 pm
Reply with quote

show us your working storage definitions

show us your code


cut and paste to a bbcode (Code) block.

if you don't understand bbcode, here is the link:

ibmmainframes.com/faq.php?mode=bbcode

and use the preview button, to double check your post.

there are 7 or 8 posts in this thread, and we still don't know what your problem is.
Back to top
View user's profile Send private message
Krishna Velamur

New User


Joined: 22 Aug 2008
Posts: 22
Location: Hyderabad

PostPosted: Thu Sep 04, 2008 10:44 am
Reply with quote

As I wrote earlier, the problem should be that the user has declared a variable of length 4 (say W-X PIC X(4)).

The values from input file is being moved to this variable and String function is used to append .LIST

String
W-X delimited by size
'.LIST'
into W-OUTPUT.

Because of this code the output is ABCD.LIST and ABC .LIST
Instead of the above code you should use

String
W-X delimited by space
'.LIST'
into W-OUTPUT.

Hope this helps.
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 -> COBOL Programming

 


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 8
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