For Programmers: Free Programming Magazines  


Home > Archive > Cobol > January 2005 > Re: Cobol (Move field using <corresponding> syntax) question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Cobol (Move field using <corresponding> syntax) question
Rick

2005-01-20, 3:55 pm

Hi,
Thanks all for the advice given :-)

By the way, my concern now is that if my o/p file declaration "length" is
different from
my i/p file "length", will the syntax "corresponding" still work as when I
o/p, I need
to unpack those i/p field that were declare as pack to o/p as alphan,
something
like o/p as 0000123456.88+ . From here, length declaration will definitely
be different.

In addition, the input file has a lot of fields inside and if use the syntax
MOVE to move
the input field 1 by 1 to the o/p field, coding will be long and
inefficient.

Hope the syntax <corresponding> will address my 2 concern above.





"Rick" <leng1@bigfoot.com> wrote in message
news:csbi13$4gk$1@mawar.singnet.com.sg...
> Hi,
> I had a question and appreciate someone out there could help advise.
> Thanks in advance :-)
>
> Actually, need to process an input file, extract the full record(based on
> condition) and output it to a flat file.
> However, for all PACKED input field, need to output as ALHANUMERIC into
> the output file.
>
> As the input file has a lot of fields, I was wondering if there is a way
> in which we can move the all the input file
> fields to the output files without having to use the syntax <MOVE> to move
> each of the input field to the output field.
>
> Heard that there is a syntax which can do that. It's something called
> <CORRESPONDING>
>
> 1) Can someone enlightented how this syntax can be used and how to code
> (Appreciate if can show an example) ?
>
> 2) In addition, does the above (1) syntax work if the input field is a
> PACKED and for the output field, I want it
> to be APLHA ?
>
> Thanks in advance :-)
>
>
>



Binyamin Dissen

2005-01-20, 3:55 pm

On Sun, 16 Jan 2005 20:27:46 +0800 "Rick" <leng1@bigfoot.com> wrote:

:>By the way, my concern now is that if my o/p file declaration "length" is
:>different from
:>my i/p file "length", will the syntax "corresponding" still work as when I
:>o/p, I need
:>to unpack those i/p field that were declare as pack to o/p as alphan,
:>something
:>like o/p as 0000123456.88+ . From here, length declaration will definitely
:>be different.

MOVE CORRESPONDING is simply a shortcut way to specify a MOVE for each field
that is in both records. It will follow the rules for simple MOVE, including
converting packed to display, truncating/padding, etc.

--
Binyamin Dissen <bdissen@dissensoftware.com>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com