Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Variable field-size?
I've scoured every internet resource I know, but can't figure out if it
is possible to do pull this off.  Here's the scenario:

I have a file that consists of 14 segments that are each 16,A long.
I have a separate file that I access that contains the user-configured
size for each segments.  For instance, the first segment could be up to
16 long, but the user has said that it should only be 2 long.  In other
programs that I have, I read the first file and then segment by
segment, pull in what the user has said the size should be.  Using this
data, I can substring the fields and then string them all together for
a nice clean presentation.  All is well.

Now I want to put them on a screen where a user can input into these
fields.  I don't want to display the full 16,A field, though.  I want
to limit the size of the screen field based on the user-configuration
pulled from this separate file.  I've seen lots of posts regarding
varying-length records, but my file is always the same size.  Its these
14 fields that will be different sizes at each different run-time.  Any
help or pointing to other resources would be appreciated--or am I way
off-base on this ever working?


Report this thread to moderator Post Follow-up to this message
Old Post
Hitch
07-06-06 11:55 PM


Re: Variable field-size?
On 6 Jul 2006 13:51:56 -0700, "Hitch" <bdrinkall@verizon.net> wrote:

>I've scoured every internet resource I know, but can't figure out if it
>is possible to do pull this off.  Here's the scenario:
>
>I have a file that consists of 14 segments that are each 16,A long.
>I have a separate file that I access that contains the user-configured
>size for each segments.  For instance, the first segment could be up to
>16 long, but the user has said that it should only be 2 long.  In other
>programs that I have, I read the first file and then segment by
>segment, pull in what the user has said the size should be.  Using this
>data, I can substring the fields and then string them all together for
>a nice clean presentation.  All is well.
>
>Now I want to put them on a screen where a user can input into these
>fields.  I don't want to display the full 16,A field, though.  I want
>to limit the size of the screen field based on the user-configuration
>pulled from this separate file.  I've seen lots of posts regarding
>varying-length records, but my file is always the same size.  Its these
>14 fields that will be different sizes at each different run-time.  Any
>help or pointing to other resources would be appreciated--or am I way
>off-base on this ever working?

I do this with delimited fields for spread sheets.   One way I compact
them it to have a subroutine that compacts each field right before
writing the file (using reference modification).   This works because
of the delimiters.    If you don't want the delimiters, then put them
in the intermediate record and have the subroutine take them off while
copying to the output record.

Posted Via mcse.ms Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.mcse.ms

Report this thread to moderator Post Follow-up to this message
Old Post
Howard Brazee
07-06-06 11:55 PM


Re: Variable field-size?
Hitch wrote:

> Now I want to put them on a screen where a user can input into these
> fields.  I don't want to display the full 16,A field, though.  I want
> to limit the size of the screen field based on the user-configuration
> pulled from this separate file.

01  Field-16                      PIC X(16).
01  Field-15 REDEFINES Field-16.
03  Field-15X              PIC X(15).
03  FILLER                 PIC X(1).
01  Field-14 REDEFINES Field-16.
03  Field-14X              PIC X(14).
03  FILLER                 PIC X(2).
..

EVALUATE Field-Size
WHEN 16
DISPLAY Field-16 AT xxyy
ACCEPT Field-16  AT xxyy
...

Or you could use, say, Flexus SP/2 where you can define a set of fields
at design time and then rejig at runtime to the required sizes.


Report this thread to moderator Post Follow-up to this message
Old Post
Richard
07-06-06 11:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 11:01 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.