Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
I need to remove low values in my field

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
shymala

New User


Joined: 26 Jul 2018
Posts: 5
Location: india

PostPosted: Sun Jul 29, 2018 11:15 am    Post subject: I need to remove low values in my field
Reply with quote

Hi All,

I have a file which has a detail records and i am extracting the data for a particular field of pic x(16) which contains data+low values. The data in the field is varying for each record. If i do HEX ON i can see hexadecimal values in that. If I open the file in browse mode i can see the data as 123456789-12.....

o/p - i need to write only the data part(123456789-12) in the output file.

As of now i am using the solution as

1.inspect with replacing all low values by spaces
2. using reverse function i am trying to retrieview only the data part but i am failing at the count part.


Can anyone provide me the solution along with the code or explanation.

Thanks
Shyamala
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1567
Location: Andromeda Galaxy

PostPosted: Sun Jul 29, 2018 2:12 pm    Post subject:
Reply with quote

Your explanation is not clear at all

Quote:
If i do HEX ON i can see hexadecimal values in that. If I open the file in browse mode i can see the data as 123456789-12.....

Should I assume when you use HEX on it is low-values and when you browse the data is in not a low-value??


Please paste samples of obfuscated value with hex on and within code tags for us to understand

Why do you need a reverse function icon_confused.gif icon_confused.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2064
Location: NY,USA

PostPosted: Sun Jul 29, 2018 6:49 pm    Post subject:
Reply with quote

First of all if you want to keep the same variable and just need to replace low-values by spaces then you don’t need anything but just inspect and if you want to extract the number part and would like to move it to another field then use substring after replacing low-values to spaces.
Back to top
View user's profile Send private message
shymala

New User


Joined: 26 Jul 2018
Posts: 5
Location: india

PostPosted: Sun Jul 29, 2018 10:10 pm    Post subject: Reply to: I need to remove low values in my field
Reply with quote

Hi Rohit,

How to use substring can you give me one example of the code.

Thanks
Shymala
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2126
Location: UK

PostPosted: Mon Jul 30, 2018 4:37 am    Post subject: Reply to: I need to remove low values in my field
Reply with quote

Is it so hard to look in the index of the COBOL Language Refernce manual for Substring and then go the the linked page?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1303
Location: Israel

PostPosted: Mon Jul 30, 2018 7:25 pm    Post subject:
Reply with quote

You have to explain yourself better than that.
  • What do you mean by 'data'. Everything, including low-values, can be data !
  • Is the 'data' you need a number or is it alphanumeric ?
  • This means nothing: (you can look at low-values in hexa and you will see hexadecimal values as well)
    Quote:
    If i do HEX ON i can see hexadecimal values in that
  • What does that mean ?
    Quote:
    ... 123456789-12 .....
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 447
Location: USA

PostPosted: Tue Jul 31, 2018 1:33 am    Post subject: Reply to: I need to remove low values in my field
Reply with quote

This should also work:
Code:
PERFORM VARYING X FROM 1 BY 1 UNTIL MYFIELD(X:1) = LOW-VALUES OR X > 16
   MOVE MYFIELD(X:1) TO NEWFIELD(X:1)
END-PERFORM
Back to top
View user's profile Send private message
shymala

New User


Joined: 26 Jul 2018
Posts: 5
Location: india

PostPosted: Wed Aug 01, 2018 6:16 pm    Post subject: Reply to: I need to remove low values in my field
Reply with quote

Hi all,

I have resolved my issue by using function reverse. Thanks all of you for responding to my question.But now I need 1 more info let me explain.

I need to concatenate 2 fields in my o/p file.
as of now I am getting the o/p as

{12345678} {1:1234:456}
I have a gap in b/w these 2 fields because of varying length of field1 the actual o/p should be
{12345678}{1:1234:456}

the important thing here is field 1 will be having varying length. say for example
{123}
{12345}
the 1st field length is 16 characters.

can anyone help me in solving this problem
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2126
Location: UK

PostPosted: Wed Aug 01, 2018 7:23 pm    Post subject: Reply to: I need to remove low values in my field
Reply with quote

Please start a new topic for a new question.
When doing so please specify if that is the only space in your data (between fields) or can your actual data contain spaces?
Also show what you have tried. You actually have a possible solution, using substring (reference modification in COBOL terminology), in a previous post in this topic.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    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 Replace comp-3 field value to comp-3 ... dharmaraok DFSORT/ICETOOL 5 Fri Sep 14, 2018 3:46 pm
No new posts Extra data in overlay field speermb DFSORT/ICETOOL 2 Thu Sep 13, 2018 6:04 pm
No new posts RPG II Problem with unsigned Packed d... Andi1982 All Other Mainframe Topics 6 Tue Sep 11, 2018 6:11 pm
No new posts Remove selected duplicate rows from t... hnharish DFSORT/ICETOOL 3 Wed Sep 05, 2018 3:11 am
No new posts How can we create a flat file in JAVA... jasorn Java & MQSeries 2 Wed Aug 08, 2018 3:08 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us