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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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