IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can a alphanumeric data be moved to a group variable ?


IBM Mainframe Forums -> COBOL Programming
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
nico_neoz

New User


Joined: 02 Apr 2016
Posts: 18
Location: India

PostPosted: Mon Oct 30, 2017 8:28 am
Reply with quote

The group variable that I am referring to here has a sub field level in the form of an array of numeric type variable, similar to the one below

Code:

03 WS-A.
     05  WS-N PIC  OCCURS 20 TIMES 9(01).
03 WS-B PIC X(20) VALUE 'ABC123456'.


Now let's say we move the data from WS-B to WS-A, what will be the data in WS-A
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Mon Oct 30, 2017 4:35 pm
Reply with quote

What resulted when you attempted to do it?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Mon Oct 30, 2017 4:37 pm
Reply with quote

Beginners forum question.
Please do some research and try by yourself.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Mon Oct 30, 2017 6:52 pm
Reply with quote

Rohit Umarjikar wrote:
Beginners forum question.
Please do some research and try by yourself.

In average, about 90% of new questions are received from those "experts" mostly trained in computer games... icon_pray.gif
I would call them 'the iksperds" icon_axe.gif
Back to top
View user's profile Send private message
nico_neoz

New User


Joined: 02 Apr 2016
Posts: 18
Location: India

PostPosted: Tue Oct 31, 2017 7:14 am
Reply with quote

dneufarth wrote:
What resulted when you attempted to do it?

The data was passed as such, no abends.
Back to top
View user's profile Send private message
nico_neoz

New User


Joined: 02 Apr 2016
Posts: 18
Location: India

PostPosted: Tue Oct 31, 2017 7:16 am
Reply with quote

Rohit Umarjikar wrote:
Beginners forum question.
Please do some research and try by yourself.


I did, but the result was not as I expected it to be.
Back to top
View user's profile Send private message
nico_neoz

New User


Joined: 02 Apr 2016
Posts: 18
Location: India

PostPosted: Tue Oct 31, 2017 7:17 am
Reply with quote

sergeyken wrote:
Rohit Umarjikar wrote:
Beginners forum question.
Please do some research and try by yourself.

In average, about 90% of new questions are received from those "experts" mostly trained in computer games... icon_pray.gif
I would call them 'the iksperds" icon_axe.gif


Not getting you. icon_question.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Oct 31, 2017 7:23 am
Reply with quote

Quote:
I did, but the result was not as I expected it to be.
So what result did you get and what result did you expect?

The Enterprise COBOL Language Reference manual tells you all about how COBOL works -- including which MOVE statements are allowed and which are not. You should bookmark it so you can reference it frequently for questions like what you posted.
Back to top
View user's profile Send private message
nico_neoz

New User


Joined: 02 Apr 2016
Posts: 18
Location: India

PostPosted: Tue Oct 31, 2017 7:48 am
Reply with quote

Robert Sample wrote:
Quote:
I did, but the result was not as I expected it to be.
So what result did you get and what result did you expect?

The Enterprise COBOL Language Reference manual tells you all about how COBOL works -- including which MOVE statements are allowed and which are not. You should bookmark it so you can reference it frequently for questions like what you posted.


I expected an abend to occur as we are trying to move alphanumeric values to a numeric array, instead the data was moved as such.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Tue Oct 31, 2017 11:28 am
Reply with quote

an old discussion lends some insight

ibmmainframes.com/about6130.html
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Oct 31, 2017 4:37 pm
Reply with quote

Topic closed as:
OP did not do his research (search the forum)
OP did not refer to the manual
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top