Page 1 of 2

Move a single variable from the Group declaration.

PostPosted: Wed May 02, 2012 10:37 pm
by Viswanathchandru
Dear all,

May be the worst question the forum ever met! but still woud request someone to guide me on this. I have some working storage declaration like this.


01 TEAM
05 NAME PIC X(09).
05 ADDRESS PIC X(15).
05 DEPT PIC X(05).

Now what my clarification is that i need to move 05 DEPT alone to a 77 clause variable or to a different variable to make some modification in my application. Is that possible. Please guide me. Apologize if i or my thoughts are wrong!


Regards,
Viswa

Re: Move a single variable from the Group declaration.

PostPosted: Wed May 02, 2012 10:42 pm
by Akatsukami
Whilst I haven't written any COBOL in years, ISTR that the syntax is:
MOVE DEPT [OF TEAM] TO ANOTHER-VARIABLE.

where the "OF TEAM" is required only if there's another subordinate variable named DEPT. What made you think (if the word is applicable in the circumstances) that the matter was more complex?

Re: Move a single variable from the Group declaration.

PostPosted: Wed May 02, 2012 10:43 pm
by Robert Sample
Of course it is possible -- unless you have never had one day of COBOL training, why would you even ask such a question?

Hint: use the MOVE statement in COBOL.

Re: Move a single variable from the Group declaration.

PostPosted: Wed May 02, 2012 10:53 pm
by Viswanathchandru
Thanks akatsukami and robert for time and reply! Sorry for not explaining the entire scenario. Here that variable which i need to move is not accepting the higher case values. hence had a thought to converting the higher case inputs to lower case through the ISPECT verb. I need only one variable that needs to be converted as per the requirement. I'm not sure where and all the variable is refered and ofcourse its a good old application and i have the load alone (for the back end modules). so, this made me to ask whether i can move a single variable alone. Apologize if i or my thoughts are wrong!


Regards,
Viswa

Re: Move a single variable from the Group declaration.

PostPosted: Wed May 02, 2012 11:00 pm
by Robert Sample
Terminology is critical in IT, where similar terms may mean very different things. Your term
higher case
is, I assume, actually UPPER CASE (all capital letters as opposed to lower case which has no capital letters). Assuming you're using some version of Enterprise COBOL (which has been avalable since September 2002), you can use intrinsic FUNCTION LOWER-CASE to convert a variable to all lower case without needing INSPECT (or "ISPECT" sic).

And the more detail you give in your post, the better the help can be. Since you didn't mention anything about upper case or lower case in your original post, there's no way we could read your mind and figure out that was your true question.

Re: Move a single variable from the Group declaration.

PostPosted: Wed May 02, 2012 11:07 pm
by Viswanathchandru
Hello robert!

Since you didn't mention anything about upper case or lower case in your original post, there's no way we could read your mind and figure out that was your true question.
yes, I agree!
Once again apologize for not being clear when i put a question on this forum!

Thanks,
Viswa

Re: Move a single variable from the Group declaration.

PostPosted: Wed May 02, 2012 11:19 pm
by dick scherrer
Hello,

Here that variable which i need to move is not accepting the higher case values
How does a PIC X(5) field reject higher/upper case values?

How are they "not accepted"?

Re: Move a single variable from the Group declaration.

PostPosted: Thu May 03, 2012 3:54 pm
by Viswanathchandru
Hello dick scherrer thanks for your time!

yes that is the one about which i'm confused. A possible show stopper question! hence decided to change it through the INSPECT verb and now as said by robert i can do it through intrensic functions.

Regards,
Viswa

Re: Move a single variable from the Group declaration.

PostPosted: Thu May 03, 2012 9:46 pm
by gokulNmf
Hi Viswanathchandru,
After going through the post even i am confused how its not accepting the Upper-Case values.
you can used "Function Upper-case(variable)" for converting it to upper case.

Quick check,
As its an old application, you can check the configuration section of the program for this predicament. Hope you find something there.
Also try moving upper case values to some other new variable and check whether its accepting. If the new variable is also not accepting then some thing is beyond the program and needs to be checked with the compiler options.
Good Luck.

Re: Move a single variable from the Group declaration.

PostPosted: Thu May 03, 2012 9:52 pm
by BillyBoyo
I have to agree to the lack of clarity. There is nothing which stops a PIC X field holding anything, any of the 256 combinations that a byte can have.

So, I assume that it is a later application in the system rejecting records because that particular field contains upper-case, so the idea has come about to "edit" the field along the way.

Even that invented explanation leaves lots of questions open....