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

Align Comma Delimited Field


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
valic

New User


Joined: 28 Jun 2006
Posts: 3

PostPosted: Thu Oct 04, 2007 6:44 am
Reply with quote

Hi All,

I need some help to align a comma delimited field in a file I am creating. What I want to do is populate a numeric edited field with COMP-3 data and align the COMP-3 data immediately following the comma in its record field.

Input is as follows:

CALC-AMT PIC Z(09)V99 COMP-3 VALUE ZERO.

Output edited field:

CALC-OUT PIC --------9.99.

If CALC-AMT is equal to 000033000 and moved into CALC-OUT the result is ,bbbb33000.00. Four leading spaces past the comma.

What I would like to do is line up CALC-OUT next to the comma ,33000.00 without the leading spaces. Is this possible?

Any help would be appreciated.

Thanks,
Jim
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Oct 04, 2007 7:25 am
Reply with quote

Hello,

Yes, it is possible, but would take a bit of work.

You could use CALC-OUT PIC -9999999.99. and the result would be 000033000.00 for a positive value. This result should work anywhere the 33000.00 would work. It's a few bytes longer, but numerically equal.

Please let us know if there is more to the requirement.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Oct 04, 2007 6:40 pm
Reply with quote

Only problem is you can't have a PIC Z for a comp-3 field.
Back to top
View user's profile Send private message
valic

New User


Joined: 28 Jun 2006
Posts: 3

PostPosted: Thu Oct 04, 2007 11:12 pm
Reply with quote

Sorry about the PIC Z in the comp-3 field.

It should have been CALC-AMT PIC S(09)V99 COMP-3 VALUE ZERO.

Thanks for your quick response.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Oct 05, 2007 2:10 am
Reply with quote

Hello Valic,

Do you have a solution you are satisfied with?
Back to top
View user's profile Send private message
valic

New User


Joined: 28 Jun 2006
Posts: 3

PostPosted: Fri Oct 05, 2007 7:24 am
Reply with quote

Yes, thanks again Dick for all your assistance.

Regards, Jim
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Oct 05, 2007 8:19 am
Reply with quote

You're welcome.

Thanks for letting us know all is well icon_smile.gif
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 Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts S0C7 - Field getting overlayed COBOL Programming 2
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
Search our Forums:

Back to Top