Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us