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
 

 

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: 6966
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: 1534
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: 6966
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 Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm


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