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

UNSTRING delimited by ',' in a comma separated file


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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: 3156
Location: Tucson AZ

PostPosted: Fri Dec 01, 2006 3:31 pm
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
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: 3156
Location: Tucson AZ

PostPosted: Fri Dec 01, 2006 3:58 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top