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 Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm

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