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 READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am


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