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
 

 

what will be the output ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
gnagakishore

New User


Joined: 26 Mar 2005
Posts: 25
Location: Hyderabad

PostPosted: Tue May 17, 2005 8:31 am    Post subject: what will be the output ?
Reply with quote

UNSTRING data-field DELIMITED BY "," , OR "/ "
INTO field-1, field-2, field-3, field-4 WITH POINTER P1
TALLING IN COUNTER-1 ON OVERFLOW GOTO PARA2.

suppose while executing the above statement if it encounteres two contiguous delimiters after sending a few characters in field-1 , what will happen ?
Back to top
View user's profile Send private message

Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Tue May 17, 2005 1:20 pm    Post subject:
Reply with quote

if two contiguous delimiter was found then next variable will have spaces In ur example,FIELD2 will have spaces FILED3 will have next set of characters until an other delimiter is found.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Wed May 18, 2005 4:41 pm    Post subject: Re: what will be the output ?
Reply with quote

Hi Deepa,

I have a doubt here, whether it will be SPACES or NULL.

Can you confirm again.

Thanks & Regards,

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

New User


Joined: 01 Apr 2005
Posts: 58

PostPosted: Thu May 19, 2005 11:12 am    Post subject:
Reply with quote

Since field2 is cobol variable, while declaration itself space will be allocated. So obviously it will have spaces and not null.
Kindly let me know, if I am wrong
Back to top
View user's profile Send private message
swaran_msc

New User


Joined: 19 May 2005
Posts: 5
Location: Bangalore

PostPosted: Thu May 19, 2005 12:20 pm    Post subject:
Reply with quote

When it encounters two delimiters, the charcters b4 the first delimiter will be transferred into Field-1. After the second delimiter, the charcters will be transferred into Field-2 until it encounters another delimiter.

For an Ex

Data Field - IBM Global/,Services,Ltd

After Unstring Operation
Field-1 Value is - IBM Global
Field-2 Value is - Services
---
---

Corrections are Welcome
Back to top
View user's profile Send private message
vasanthanc

New User


Joined: 01 Apr 2005
Posts: 58

PostPosted: Thu May 19, 2005 2:08 pm    Post subject: Re: what will be the output ?
Reply with quote

here, the question is about, what will be value if field2, if 2 delimeters are there consecutively
Back to top
View user's profile Send private message
vidyasaraswathi

New User


Joined: 10 May 2005
Posts: 72

PostPosted: Thu May 19, 2005 2:56 pm    Post subject: Re: what will be the output ?
Reply with quote

Hi,
If the Data Field is IBM Global/,Services,Ltd
then the value of field2 is Services.

If the Data Field is IBM Global/,/Services,Ltd
then the value of field2 is /Services
Back to top
View user's profile Send private message
vidyasaraswathi

New User


Joined: 10 May 2005
Posts: 72

PostPosted: Thu May 19, 2005 4:36 pm    Post subject: Re: what will be the output ?
Reply with quote

Hi all,
I agree with Mahesh.
Please ignore my previous reply.

I executed the Unstring example in the mainframes and found that if 2 continuous delimiters are encountered after some characters are transferred to field1, then the field2 will contain spaces.

Here are the result of the execution in different cases:

1)Data Field - IBM GLOBAL,/SERVICES/LTD

field1=IBM GLOBAL
field2= spaces
field3=SERVICES

2) Data Field - IBM GLOBAL,,SERVICES/LTD

field1=IBM GLOBAL
field2= spaces
field3=SERVICES

3)Data Field -IBM GLOBAL,,,SERVICES/LTD

field1=IBM GLOBAL
field2=spaces
field3=spaces
Back to top
View user's profile Send private message
Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Thu May 19, 2005 4:44 pm    Post subject:
Reply with quote

Field2 will be spaces. For above string "IBM Global/,Services,Ltd "
which is under discussion the result would be

FIELD1= IBM GLOBAL
FIELD2= <SPACES>
FILED3=SERVICES

why don't you check for yourself.
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 Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm
This topic is locked: you cannot edit posts or make replies. output data in CSV Format janmejay DFSORT/ICETOOL 3 Sat Oct 15, 2016 2:16 pm


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