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
 
replacing the column values

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

New User


Joined: 20 Apr 2012
Posts: 20
Location: chennai

PostPosted: Tue May 22, 2012 9:22 pm    Post subject: replacing the column values
Reply with quote

In one of my application the column name is NAME it contains the all the name ex: MArk, John,Chinthan,... actually our req is we have to replace the all small letters with 'XXXX'.in a clear way the output of the name should be like this;

MAXX,
JXXX,
CXXXXXXX

It wil really help to me please can any one provide a solution to me,i had tried with Inspect with Replace but i am facing some soc4...
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Tue May 22, 2012 9:32 pm    Post subject:
Reply with quote

sounds like homework.

where/what is the structure that contains he name-field
that you are INSPECTing?
what does your INSPECT statement look like?

have no idea what you created for an INSPECT REPLACING
but
suggest you use Format 4 INSPECT CONVERTING
Back to top
View user's profile Send private message
Pandora-Box

Moderator


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

PostPosted: Tue May 22, 2012 9:37 pm    Post subject:
Reply with quote

If it is a homework someone would expect you to try it without INSPECT icon_lol.gif

And if you did try using INSPECT and faced issues please paste the piece of code which you tried

and also find the link with some samples here
Back to top
View user's profile Send private message
swarnasuneel

New User


Joined: 20 Apr 2012
Posts: 20
Location: chennai

PostPosted: Tue May 22, 2012 9:40 pm    Post subject: Reply to: replacing the column values
Reply with quote

Inspect Ws-name converting 'a thru z' to all 'xxx'

my problem is i am unable to use the small a,b,c,d...and that to we have to replace all the names in name field to be masked..
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Tue May 22, 2012 9:51 pm    Post subject:
Reply with quote

christ on a crutch!

05 WS-TOBE-CHANGED pic x(26) value 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.

05 WS-CHANGED-TO PIC X(26) VALUE ALL 'X'.

in your housekeeping section (beginning of program, only executed once)

MOVE FUNCTION LOWER(WS-TO-BE-CHANGED) TO WS-TO-BE-CHANGED.

and in your logic processing each record
INSPECT WS-NAME CONVERTING WS-TO-BE-CHANGED TO WS-CHANGED-TO END-INSPECT

you could also change your profile to CAPSOFF,
and enter the lower-case alpha,
but i would rather you use the function lower,
so as not to confuse you with too much new stuff,
especially the problem created by mixed-case COBOL programs.

COLUMN is DB2 and only within sql.

once data is in a COBOL program, it is a field
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: Tue May 22, 2012 10:12 pm    Post subject: Reply to: replacing the column values
Reply with quote

Hello,

Why did you repost the same question again icon_sad.gif

This duplicate is being locked.

d

My bad - now unlocked . . . icon_redface.gif icon_redface.gif
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 Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
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