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

Change in Case After MOVE statement


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
apandey

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Fri Jun 03, 2011 8:01 pm
Reply with quote

Hi ALL,

I have a variable "ASN-PART-OR-CNTNR-TYP PIC X(1) from 1 copybook,
another variable ASC-CODE-PART-CNTNR PIC X. from another copybook.

I have a move statement.
MOVE ASN-PART-OR-CNTNR-TYP TO ASC-CODE-PART-CNTNR
I displayed both fields in SYSOUT, Its value is as below:

ASN-PART-OR-CNTNR-TYP : P (P in CAPS)
ASC-CODE-PART-CNTNR : p (P in small)

I want to know why value is changing from CAPS to small, I havent used
any COBOL Case function on any of the field.
COz exact below this statement
I am checking IF ASC-CODE-PART-CNTNR = 'P' , so its not statisfying IF and going else loop.

Can anyone pls help.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Jun 03, 2011 8:08 pm
Reply with quote

That would not happen, I think there is something missing it your explanation of what was done.
Back to top
View user's profile Send private message
apandey

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Fri Jun 03, 2011 8:15 pm
Reply with quote

Nothing is missing as per my given information,.
I m also surprised to see this kind of issue. I'hv also never faced such issue.
There is only MOVE statement in whole program on this 2 fields.
Both the copybook are initialised in starting in procedure division.
Then input file is read thru 1 copybook and mentioned field is moved to other field of 2nd files copybook, which i displayed above.
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: Fri Jun 03, 2011 8:28 pm
Reply with quote

Quote:
I want to know why value is changing from CAPS to small, I havent used
any COBOL Case function on any of the field.
Something you have not described (in the program) is making the change. The MOVE is not the problem.

P is x'D7' while p is x'97'. Something has changed the D to a 9.

I recommend working with someone at your site to go through all the code to identify the change.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Jun 03, 2011 9:02 pm
Reply with quote

This happens often when CAPS ON is set and someone moves the space bar or alters any value on the source-code line and then ALL lower-case on that line are translated to upper-case.

To get around this, use the lower-case value of a letter in hex-notation, as has been suggested.

Bill
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jun 03, 2011 9:17 pm
Reply with quote

Bill,
i am as confused (well not quite) as you are.

he is saying that the first pic x field contains an upper-case P.
his cobol program moves the pic x field to a second pic x field,
and when he displays the data, it is
upper-case P in the source field
lower-case p in the destination field.

well, we all know that a simple cobol move statement will not affect the 'case' of alphabetics.

but,
since so many of the 'new programmers' insist on storing numeric fields in x type
and the field names are suspect numeric fields:
ASN-PART-OR-CNTNR-TYP
ASC-CODE-PART-CNTNR

emphasis is mine
and an uppercase as well as lower case p is a -7.

........
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jun 03, 2011 9:31 pm
Reply with quote

Time for a longer piece of the code and the data definitions, in the Code tags please, and copy/pasted so no typos introduced.

As with others, no way a move can do that in Cobol.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jun 03, 2011 10:09 pm
Reply with quote

Discovered by TS 11 minutes after posting original.

Move made by accident to ASC-CODE-PART-CNTR.

Previously ASC-CODE-PART-CNTNR had been changed to lower-case for a different transaction in a different part of the program.

I could be wrong :-)

But where is TS with his interesting problem>

Anyway, my fantasy, I mean my educated guess, gives me another opportunity to emphasise meaningful data-names.

ASC-CODE-PART-CNTNR why? You got a keyboard with no vowels by the time you typed the last part of the name? What did it save anybody? Lined-up against confusion potentially caused? (Not blaming you, TS, until you tell us you defined the copybooks).
Back to top
View user's profile Send private message
GlobalGyan

New User


Joined: 31 Jan 2006
Posts: 28

PostPosted: Sun Jun 05, 2011 11:44 am
Reply with quote

Would you be able to show a screenshot of a debugging tool for the move statement? perhaps the values of variables just afterthe move statement? This might shed some light on this move mystery.
Also show the exact screenprint of the IF loop, it could be that the IF condition may have a 'P ' or ' P' or 'p' ..
Back to top
View user's profile Send private message
nigelosberry

New User


Joined: 06 Jan 2009
Posts: 88
Location: Ggn, IN

PostPosted: Mon Jun 06, 2011 11:39 am
Reply with quote

apandey wrote:
Nothing is missing as per my given information,.
I m also surprised to see this kind of issue. I'hv also never faced such issue.


If I am the one facing this issue. There is certainly something wrong with my code or the way I am doing it. icon_smile.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jun 06, 2011 11:47 am
Reply with quote

another thread that should be locked and deleted
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jun 06, 2011 12:38 pm
Reply with quote

Dick, do you mean to say you see no value in keeping a topic like this?

Code:

MOVE A-PICX-SENDING-FIELD TO A-PICX-RECEIVING-FIELD
IF A-PICX-SENDING-FIELD NOT EQUAL TO A-PICX-RECEIVING-FIELD
      DISPLAY "Who you gonna call?" (background music by Ray Parker Jr)
      CALL "www.ibmmainframes.com"
END-IF


FX: keys clinking, axe being sharpened
Back to top
View user's profile Send private message
apandey

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Mon Jun 06, 2011 7:21 pm
Reply with quote

Hi All,

Thanks all for giving ur valuable time and sorry that I am replying late.
As Robert Suggest in his 1st reply that to work with someone at my site.
I did the same, Even we were not able to crack that problem. But what we
have done is deleted that para and re-written that para. Initialized both the copybook calling before that para.

When we executed, program ran fine. So Thanks everyone for ur valuable reply.

1 more thing,
HI dbzTHEdinosauer,
I saw ur reply about naming and datatype of mentioned 2 fields.
Believe me both were element of copybook which were already implemented way long back and both were alphanumeric fields.
_________________
Regards,
Ashutosh
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jun 06, 2011 8:48 pm
Reply with quote

Hello,

Quote:
Believe me both were element of copybook which were already implemented way long back and both were alphanumeric fields.
That much we can believe.

The problem was within the procedural code not the data definition(s). . .
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jun 06, 2011 9:00 pm
Reply with quote

I don't suppose you have the compile listing from the run which went wrong?

Not much point in "intialising" the fields. One is from a file, the other you say is the receiving field of the move, presumably you think with no other route through the program.

If it works now, the code you took out of the paragraph is different from the code you put in. Or the data is different, in which case the problem might come back.

How do you know it ended up with lowercase "p" anyway? Chasing smoke and shadows. End of story unless you have the listing.
Back to top
View user's profile Send private message
nigelosberry

New User


Joined: 06 Jan 2009
Posts: 88
Location: Ggn, IN

PostPosted: Tue Jun 07, 2011 12:18 am
Reply with quote

Its the TS who has to decide. But settling with a solution without knowing what exactly was the problem might turn out be risky.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts 3270 personal communications. Can't c... TSO/ISPF 2
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts SELECT from data change table DB2 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
Search our Forums:

Back to Top