View previous topic :: View next topic
|
Author |
Message |
apandey
New User
Joined: 31 Aug 2009 Posts: 73 Location: Mumbai
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
That would not happen, I think there is something missing it your explanation of what was done. |
|
Back to top |
|
|
apandey
New User
Joined: 31 Aug 2009 Posts: 73 Location: Mumbai
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
GlobalGyan
New User
Joined: 31 Jan 2006 Posts: 28
|
|
|
|
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 |
|
|
nigelosberry
New User
Joined: 06 Jan 2009 Posts: 88 Location: Ggn, IN
|
|
|
|
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. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
another thread that should be locked and deleted |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
apandey
New User
Joined: 31 Aug 2009 Posts: 73 Location: Mumbai
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
nigelosberry
New User
Joined: 06 Jan 2009 Posts: 88 Location: Ggn, IN
|
|
|
|
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 |
|
|
|