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: 1529
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 DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am


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