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
 

 

Align Comma Delimited Field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Align Comma Delimited Field
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

Site Director


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

PostPosted: Thu Oct 04, 2007 7:25 am    Post subject:
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    Post subject:
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    Post subject: Align Comma Delimited File
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

Site Director


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

PostPosted: Fri Oct 05, 2007 2:10 am    Post subject:
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    Post subject: Align Comma Delimited Field
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

Site Director


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

PostPosted: Fri Oct 05, 2007 8:19 am    Post subject:
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    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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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