View previous topic :: View next topic
|
Author |
Message |
vikas.b
New User
Joined: 24 Aug 2006 Posts: 2 Location: pune
|
|
|
|
Hi, I have a requirement where i need to map A PIC X(20) to B X(20)...A can have data as well as low values... '1234.....'. How do I remove the low values from A before the moves...I have a copybook with many fields potentially having data and low values in them..Is there a way to initialize A keeping data as it is before the moves or some other way? |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
What about INSPECT REPLACING? |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Why do you feel it necessary to initialize a field which will then have a value assigned to it? |
|
Back to top |
|
|
vikas.b
New User
Joined: 24 Aug 2006 Posts: 2 Location: pune
|
|
|
|
We donot want any low values in destination field. same case with numeric if source has low values then it should be replaced with zeroes...
Will inspect replace low values with spaces in Xnumeric fields n with zeroes in numeric? |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Akatsukami wrote: |
Why do you feel it necessary to initialize a field which will then have a value assigned to it? |
Better reread the TS initial post! |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Craq Giegerich wrote: |
Akatsukami wrote: |
Why do you feel it necessary to initialize a field which will then have a value assigned to it? |
Better reread the TS initial post! |
It's a bit unclear to me. Am I to understand that what is going to be done is to move A to B, or B to A? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Are you talking about CICS map fields or variables in a batch program? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forums,
As you can see from the replies, different people have a different understanding of what you want to do (and you thought it was a simple question, right ).
Suggest you post the rules of what you want by using a few examples. Show what you can "have" and what "output" (data field content) is wanted.
If a field has some "good" characters and some "bad" ones, what is the rule for handling these?
Why is there this kind of data in the input file? Possibly "fixing" the process that creates the file should be considered? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
vikas.b wrote: |
We donot want any low values in destination field. same case with numeric if source has low values then it should be replaced with zeroes...
Will inspect replace low values with spaces in Xnumeric fields n with zeroes in numeric? |
INSPECT is only able to do what you ask it to do. There is a link to IBM manuals at the top of the page, including the Cobol manuals.
It seems from what you have shown so far that the low-values are "trailing". Unless they represent zeros in a number, it would be a bad idea to change them to zeros.
You need to follow Dick's advice and show explanatory sample data. You may need INSPECT for the alpha-numeric values (and FUNCTION REVERSE if you only need to remove trailing low-values but preserve leading or embedded ones) and UNSTRING for the numeric values. So how do you know which is which? They are both in the same field... |
|
Back to top |
|
|
|