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
 

 

How to elimate space in fle

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
natarajanibm
Warnings : 1

New User


Joined: 21 Mar 2009
Posts: 9
Location: chennai

PostPosted: Tue Aug 03, 2010 3:36 pm    Post subject: How to elimate space in fle
Reply with quote

input:- A 10 20 30 40 B 5 7 10 14 C 8 12 14 16.... output:- A = 100,B=36,C=50. Here spaces are considered between numbers. When we give input as above, the numbers should be added n displayed.So please help me out
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Aug 03, 2010 3:40 pm    Post subject:
Reply with quote

HOMEWORK ???
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: Wed Aug 04, 2010 4:27 am    Post subject:
Reply with quote

Hello,

Other than having someone write this for you, what help are you looking for?

What have you done so far? Where are you stuck?
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Wed Aug 04, 2010 11:54 am    Post subject:
Reply with quote

look at the STRING function in COBOL

in case you want to process 1 field at a time, you could use
STRING WITH POINTER CLAUSE


but your title seems confusing
" How to elimate space in fle "

could you explain it in better way
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Aug 04, 2010 12:14 pm    Post subject:
Reply with quote

smijoss wrote:
look at the STRING function in COBOL


more likely UNSTRING into n-number of char fields,
where n = length of input / 2 (1 for the char, 1 for the space)
then all the char fields defined in a table,
PSEUDO CODE
Code:

move spaces to display-key
perform varying index
  IF field(index) NUMERIC
  then
     add field(index) to display-counter
  else
     if display-key > spaces
        display display-key display-counter
     end-if
     move field(index) to display-key
     move zero to display-counter
  end-if
end-perform
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 Difference space showed for TS and it... autobox DB2 1 Thu Apr 14, 2016 1:07 pm
No new posts How to find Table-space and Index-spa... venksiv DB2 5 Wed Feb 03, 2016 6:16 pm
No new posts VTS and space BobGilbert All Other Mainframe Topics 2 Mon Jan 11, 2016 5:08 am
No new posts DFSORT - Space issue santosh_g DFSORT/ICETOOL 3 Fri Sep 04, 2015 7:44 am
No new posts How to read the db2 table space statu... cmsmoon DB2 3 Fri Apr 17, 2015 2:29 am


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