Joined: 21 Dec 2003 Posts: 2 Topics: 2 Location: Bangalore , India
Posted: Sat Jan 24, 2004 6:50 am Post subject: Unstring
Hi ,
I have a requirement to Unstring a csv flat file in MVS (which is basically FTPed from Novell).
Here is the sample data (4 recs)-
70111,200303,-5962547.3,-5558445.36,-5823796.08
70112,200303,-3760923.67,-3227894.59,-3715484.07
70113,200303,-3175396.4,-2916627.3,-3291134.8
70114,200303,-3386233.83,-2660795.94,-3181292.63
have a requirement to Unstring a csv flat file in MVS (which is basically FTPed from Novell).
Here is the sample data (4 recs)-
70111,200303,-5962547.3,-5558445.36,-5823796.08
70112,200303,-3760923.67,-3227894.59,-3715484.07
70113,200303,-3175396.4,-2916627.3,-3291134.8
70114,200303,-3386233.83,-2660795.94,-3181292.63
You can't realistically unstring a number directly into a numeric field.
I think your best bet is to string them into alpha fields and then use FUNCTION NUMVAL() to convert them to true numerics.
I think your best bet is to string them into alpha fields and then use FUNCTION NUMVAL() to convert them to true numerics.
I don't think that's an option. The orignal post says their compiler 'does not support reference modification'. Ref mod was introduced at COBOL II so this implies he is using the absolutely ancient and unsupported OS/VS COBOL. FUNCTION appears even later than ref.mod - in the first LE version of COBOL I believe (?COBOL/370).
Still, it would be a fun programming excercise for the poster to write the equivalent of FUNCTION NUMVAL in OS/VS COBOL.
I don't think that's an option. The orignal post says their compiler 'does not support reference modification'. Ref mod was introduced at COBOL II so this implies he is using the absolutely ancient and unsupported OS/VS COBOL. FUNCTION appears even later than ref.mod - in the first LE version of COBOL I believe (?COBOL/370).
You know, you may be right. I just took that to be a specific limitation rather than a clue that it was an old compiler.
Quote:
Still, it would be a fun programming excercise for the poster to write the equivalent of FUNCTION NUMVAL in OS/VS COBOL.
True enough - and not that difficult if you are confident that your data is reliable.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum