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

Replacing spaces with NULL


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

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Feb 25, 2009 1:59 pm
Reply with quote

Wont threre be any impact in the "SLA" when 50-100 million records are processed twice first thru a SORT and then a program, rather than a single pass thru the program? icon_rolleyes.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Feb 25, 2009 3:29 pm
Reply with quote

I agree with that. We can talk about the adv/disadvantages of both the approaches, but we never know which one is suitable for the OP unless we have a clear picture of the whole business process. It's upto him to decide icon_smile.gif
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Feb 25, 2009 10:25 pm
Reply with quote

aishwarya_20, I'm also curious to know why, "And also we can not use REFERENCE MODIFICATION." Is it because of an older compiler you are limited to?
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: Sat Feb 28, 2009 2:24 am
Reply with quote

Hello Vandana S,

Do you have a solution that works for you?
Back to top
View user's profile Send private message
Vandana S

New User


Joined: 17 Dec 2007
Posts: 20
Location: Mumbai

PostPosted: Mon Mar 02, 2009 3:42 pm
Reply with quote

dick scherrer wrote:
Hello Vandana S,

Do you have a solution that works for you?


Hi, most of the discussion were fruitful. However, I then came up with a lesser CPU consuming (but perhaps more time consuming) option:

PS-NBR--->X(40)
PS-NBR-TEMP---->X(40)

INITIALIZE PS-NBR-TEMP
MOVE 1 TO L
PERFORM VARYING K FROM 1 BY 1 UNTIL K > 40
IF PS-NBR (K:1) = SPACE
CONTINUE
ELSE
MOVE PS-NBR (K:1) TO PS-NBR-TEMP (L:1)
ADD 1 TO L
END-IF
END-PERFORM

Please let me know if any one has a better solution than this. Pls note that CPU consumption should also be taken in to consideration while solutioning this.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Mon Mar 02, 2009 7:15 pm
Reply with quote

I'm puzzled. You had said that you weren't allowed to use reference modification and several members (including myself) were under the impression that your compiler did not support reference modification (OS/VS COBOL). But yet, your most recent positing example uses an in-line PERFORM and the END-IF statement, which were introduced with COBOL2, along with reference modification. So, it seems that you have a compiler which supports reference modification and I'm trying to grasp exactly what the issues were from the onset of this thread.

Was this a shop restriction and/or did management prohibit its use altogether?

Enquiring minds want to know....

Bill
Back to top
View user's profile Send private message
Vandana S

New User


Joined: 17 Dec 2007
Posts: 20
Location: Mumbai

PostPosted: Mon Mar 02, 2009 7:23 pm
Reply with quote

Not sure why the discussion talked about not being able to use reference modification,etc. If you check my post right at the onset, it would just tell you what my requirement is and a quicker and an efficient way to acheive it. I hope this puts to rest all the doubts.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Mar 02, 2009 9:41 pm
Reply with quote

Don't you hate it when somebody gives replies as if he was the original requester?
Very often, there is a small difference in the environment, or in the request itself,
and when this happens, we are just loosing our time!

Back to the subject:
In the end, it is the plain byte-by-byte process of the field that won the race, isn't it ??
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Mar 03, 2009 12:04 am
Reply with quote

Quote:
In the end, it is the plain byte-by-byte process of the field that won the race, isn't it ??
Guess so . icon_smile.gif
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Mar 03, 2009 1:26 am
Reply with quote

aishwarya_20 wrote:
That will be a simple approach but it will use more CPU time. And also we can not use REFERENCE MODIFICATION.

By using Inspect verb we will come to know the number of spaces in between the INPUT string. After that we will use UNSTRING verb to store the strings in ARRAY same number of times as spaces.

Then we can use STRING verb.

I pointed to the wrong member (not the original OP) regarding the inability to use REFERENCE MODIFICATION.

But, this thread did get somewhat convoluted and I lost track of all the players involved. icon_confused.gif

Bill
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Mar 03, 2009 5:51 am
Reply with quote

Guess we beat that horse to death, didn't we? icon_lol.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 Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Cobol program with sequence number ra... COBOL Programming 5
No new posts the system or user abend SF0F R=NULL COBOL Programming 0
Search our Forums:

Back to Top