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
 

 

UNSTRING delimited by ',' in a comma separated file

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

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Fri Dec 01, 2006 3:06 pm    Post subject: UNSTRING delimited by ',' in a comma separated file
Reply with quote

Hi

In a comma separated file, I am using UNSTRING delimited by ','. But in my input record one item(amount) is having "5,555.00". This amount field is not fixed length. i.e it may 4 to 9 depending upon value. Please help me out how should I accomplish
Back to top
View user's profile Send private message

nbalajibe
Warnings : 1

New User


Joined: 28 Nov 2006
Posts: 75
Location: India

PostPosted: Fri Dec 01, 2006 3:25 pm    Post subject:
Reply with quote

i can't get u...
u want to seperate the items of the specific field or the total record?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Dec 01, 2006 3:31 pm    Post subject:
Reply with quote

Well, is the file comma and quote delimited? If elements with commas imbeded within them are present, simple comma delimited is the wrong format.

Is there anything significant about the field prior to the amount? How about the relitive position of the amount field (line it is always the 6th element)?
Back to top
View user's profile Send private message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Fri Dec 01, 2006 3:43 pm    Post subject:
Reply with quote

Yeah it is the 8 th element of the copybook.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Dec 01, 2006 3:58 pm    Post subject:
Reply with quote

Copybook?

Well, when you reach the eighth element, a two phase unstring would work, first to the decimal point and then to the trailing comma.
Back to top
View user's profile Send private message
SSR
Warnings : 1

New User


Joined: 26 Feb 2006
Posts: 38

PostPosted: Fri Dec 01, 2006 5:22 pm    Post subject:
Reply with quote

Hi,

First move delimited based on '.' in to a variable, if you do not have dot anywhere else in the file. Then based on the position you can move the amount field in to a different variable and then delimit rest of the variable using ','.

Regards
SSR.
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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