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
 

 

Initialize a variable keeping data as it is before

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

New User


Joined: 24 Aug 2006
Posts: 2
Location: pune

PostPosted: Fri Nov 16, 2012 12:32 am    Post subject: Initialize a variable keeping data as it is before
Reply with quote

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
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Nov 16, 2012 12:41 am    Post subject: Reply to: initialize
Reply with quote

What about INSPECT REPLACING?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Fri Nov 16, 2012 12:42 am    Post subject:
Reply with quote

Why do you feel it necessary to initialize a field which will then have a value assigned to it?
Back to top
View user's profile Send private message
vikas.b

New User


Joined: 24 Aug 2006
Posts: 2
Location: pune

PostPosted: Fri Nov 16, 2012 12:51 am    Post subject: Reply to: initialize
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Nov 16, 2012 12:52 am    Post subject:
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Fri Nov 16, 2012 1:07 am    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Fri Nov 16, 2012 1:20 am    Post subject:
Reply with quote

Are you talking about CICS map fields or variables in a batch program?
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: Fri Nov 16, 2012 1:51 am    Post subject:
Reply with quote

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 icon_wink.gif ).

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Fri Nov 16, 2012 2:31 am    Post subject: Re: Reply to: initialize
Reply with quote

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
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 Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm


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