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
Howard Abrams

2005-01-20, 3:55 pm

Not knowing what machine you are running on, I can suggest that the
"corresponding" move should work for at least part of what you need. It
will move from packed to unpacked on IBM mainframe Cobol as long as you
define the pic correctly. Once you have it unpacked, your only problem
will be to verify the sign on the receiving field. For instance, "PIC
S9(5) COMP-3" to "PIC 9(5)" will unpack the field, but you may need to
clean up the implied positive or negative sign with another program.
Rick wrote:
> 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 :-)
>
>
>


Sponsored Links







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

Copyright 2008 codecomments.com