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
 
Need to validate every character in the above variable

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

New User


Joined: 14 Jun 2006
Posts: 56

PostPosted: Tue Oct 10, 2006 2:53 pm    Post subject: Need to validate every character in the above variable
Reply with quote

I have a variable ( like ZZZZZ.ZZ).This will be populated by values in a DB2 column.

I need to validate every character in the above variable and based on values ,I need to move the corresponding values(refer NOTE below) in to the output variable

Ex: If the value is 12345.56 ,the corresponding output variable value wil be MFGYRDVX

Note: There is a table for these values like when 1 it should be M ,for 2 - F,for 3 - G etc.....like that.

Tell me some good logic which will reduce the run time.By normal method i can do but I am in search of that logic, which will reduce the run time.
Back to top
View user's profile Send private message

shanthikiran

New User


Joined: 31 May 2005
Posts: 7
Location: India

PostPosted: Tue Oct 10, 2006 4:19 pm    Post subject: Re: Need Logic for this..pls help.
Reply with quote

Hi

I think u can use the INSPECT verb for ur requirement. first u need to move the zzzz.zz value to alphanumeric variable and then use the INSPECT verb to replace the digits with the corresponding characters

Am giving the sample code here

01 WS-DATA.
03 WS-INPUT-DATA.
05 WS-DB2-DATA1 PIC zzzz.zz.
05 WS-PRG-DATA1 PIC X(7).
03 WS-OUTPUT-DATA.
05 WS-DB2-DATA2 PIC X(7).


MOVE WS-DB2-DATA1 TO WS-PRG-DATA1

INSPECT WS-PRG-DATA1 REPLACE ALL '1' BY 'M', '2' BY 'F', '3' BY 'G'
MOVE WS-PRG-DATA1 TO WS-DB2-DATA2

If Am wrong plz correct me .....

Cheers
Shanthi Kiran
Back to top
View user's profile Send private message
vin12pr
Warnings : 1

New User


Joined: 14 Jun 2006
Posts: 56

PostPosted: Tue Oct 10, 2006 4:33 pm    Post subject: Re: Need Logic for this..pls help.
Reply with quote

I will try this and let you know..thnx for the response Shashi!! icon_smile.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 Invalid XML character while producing... nikhil.bhole IBM Tools 4 Tue Mar 20, 2018 1:24 am
No new posts VALIDATE option in BIND jcl Poha Eater DB2 2 Mon Feb 26, 2018 7:08 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am

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