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
 
National datatype in cobol

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

New User


Joined: 05 May 2005
Posts: 30

PostPosted: Wed Jun 09, 2010 10:03 pm    Post subject: National datatype in cobol
Reply with quote

anybody explain about National Datatype in cobol with examples?

Eg:

declared VAR1 PIC X(3) value '001'.

I want to convert above value into S9(5) comp-3,
Example have seen that, doing the above by using Var2 as 9(3) National.
01 Var2-x
03 Var2 PIC 9(3) National.

MOVE ALL X'00' TO Var2-x
MOVE Var1 (01:1) TO Var2 (02:01)
MOVE Var1 (02:1) TO Var2 (04:01)
MOVE Var1 (03:1) TO Var2 (06:01)

Could you plz tell me waht is the value of Var2?
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: Wed Jun 09, 2010 10:10 pm    Post subject:
Reply with quote

Hello,

Quote:
declared VAR1 PIC X(3) value '001'.

I want to convert above value into S9(5) comp-3,
Has nothing to do with Natoinal. . . Unless i completely misunderstand what you want to do. If you are sure VAR1 will be numeric, simply move the NUMVAL of VAR1 to a comp-3 variable.

I don't understand why National is mentioned. . .
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Jun 09, 2010 10:12 pm    Post subject:
Reply with quote

Why not just experiment with this? Manual
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 KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm

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