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
 

 

Need to copy different length input string to output file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Need to copy different length input string to output file
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    Post subject:
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

Site Director


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

PostPosted: Tue Sep 02, 2008 1:17 am    Post subject:
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    Post subject:
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    Post subject: Reply to: Need to copy different length input string to outp
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    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Tue Sep 02, 2008 10:43 am    Post subject:
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    Post subject:
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    Post subject:
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:

http://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    Post subject: Reply to: Need to copy different length input string to outp
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm


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