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

Right Justification Logc


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

New User


Joined: 28 Nov 2007
Posts: 63
Location: Chennai

PostPosted: Fri Oct 17, 2008 8:40 pm
Reply with quote

Hi all,

I am having a scenario like this:

I am having a alphanumeric field PICX(7) in a table.I want to retrieve that value and needs to be written into the output file in the following format:
Code:
If the value in table is like "8934  " it should be converted as "0008934"
If the value in table is like "EEE   " it should be converted as "    EEE"
If the value in table is like "X8795 " it should be converted as "  X8795"

Can any one tell me the logic to do this:The logic needs to be developed to handle for the above scenarios simultaneously.

Please help
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Oct 17, 2008 8:51 pm
Reply with quote

Hi Siva,

The "values" you cite cannot be the true values of the pic x(7) field.
For example "EEE" could be any one of the following:
Code:
'  EEE  '  'EEE    '  '   EEE ', etc.
How can these values appear in the field. Can the "values" contain embedded spaces (e.g. "FF F")?

Your ans will dictate the solution(s).
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 17, 2008 10:25 pm
Reply with quote

Hello,

When you want to post data and retain the proportional spacing to show leading/trailing spaces, you can use the "Code" tag to do this (your original post has been "Code"ed).

Will the "input" always be left-justified in the field?

It appears that the non-numeric data is processed the same, so there are only 2 things to consider?
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 Sysncsort - Justification problem SYNCSORT 6
No new posts Justification of a field COBOL Programming 9
No new posts justification with edit mask? DFSORT/ICETOOL 11
No new posts Using justification in SYNCTOOL JCL & VSAM 7
No new posts Justification of Alphanumeric variabl... COBOL Programming 5
Search our Forums:

Back to Top