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
 
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: 1777
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: 1777
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: 8165
Location: East Dubuque, Illinois, USA

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: 7315

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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm

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