Move a single variable from the Group declaration.



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Move a single variable from the Group declaration.

Postby Viswanathchandru » Wed May 02, 2012 10:37 pm

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
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: Move a single variable from the Group declaration.

 

Re: Move a single variable from the Group declaration.

Postby Akatsukami » Wed May 02, 2012 10:42 pm

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?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Move a single variable from the Group declaration.

Postby Robert Sample » Wed May 02, 2012 10:43 pm

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.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Move a single variable from the Group declaration.

Postby Viswanathchandru » Wed May 02, 2012 10:53 pm

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
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: Move a single variable from the Group declaration.

Postby Robert Sample » Wed May 02, 2012 11:00 pm

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.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Move a single variable from the Group declaration.

Postby Viswanathchandru » Wed May 02, 2012 11:07 pm

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
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: Move a single variable from the Group declaration.

Postby dick scherrer » Wed May 02, 2012 11:19 pm

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"?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Move a single variable from the Group declaration.

Postby Viswanathchandru » Thu May 03, 2012 3:54 pm

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
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: Move a single variable from the Group declaration.

Postby gokulNmf » Thu May 03, 2012 9:46 pm

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.
Cheers,
Gokul
User avatar
gokulNmf
 
Posts: 114
Joined: Sat Mar 28, 2009 6:41 pm
Location: India
Has thanked: 0 time
Been thanked: 0 time

Re: Move a single variable from the Group declaration.

Postby BillyBoyo » Thu May 03, 2012 9:52 pm

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....
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post