Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Cobol > Re: Validating ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 14 of 32 Topic 4115 of 4195
Post > Topic >>

Re: Validating input file

by jeff <jmoore207@[EMAIL PROTECTED] > May 13, 2008 at 08:12 AM

On May 13, 11:07=A0am, "HeyBub" <hey...@[EMAIL PROTECTED]
> wrote:
> jeff wrote:
> > I have a input rec coming from a customer that is defined as
>
> > FD =A0DISCFILE.
> > 01 =A0DISC-REC =A0 =A0 =A0 =A0 =A0 =A0 =A0 PIC X(129).
> > 01 =A0DISC-REC2 REDEFINES DISC-REC.
> > =A0 =A0 03 =A0DISC-RECR OCCURS 129 =A0PIC X.
>
> > It is a comma-delimited file with 16 fields (15 commas). I need to
> > check and make sure that each line is only 129 characters and I assume
> > 1 LF. What would be the best way to accomplish this?
>
> First, look at the file with a hex editor to validate your assumptions.
>
> The usual purpose of a comma-delimited file is to dispense with imbedded
> blanks (else the file would have been defined as fixed length in the
first=

> place).
>
> I suspect the file, if really comma-delimited, will NOT be a uniform 129
> bytes.
>
> Going back to your question, what will you do if the record is NOT 129
(or=

> 130) bytes?
>
> Assuming a variable length record, made up of variable length fields,
your=

> code should look like:
>
> READ DISCFILE
> UNSTRING DISC-REC DELIMITED BY ',' INTO
> =A0 FIELD-1
> =A0 FIELD-2
> =A0 FIELD-3
> =A0 ...
> =A0 FIELD-15

Yeah this is the way I was leaning, Parse out to fields and have a
count
 




 32 Posts in Topic:
Validating input file
jeff <jmoore207@[EMAIL  2008-05-13 06:37:11 
Re: Validating input file
jeff <jmoore207@[EMAIL  2008-05-13 07:02:32 
Re: Validating input file
"Rick Smith" &l  2008-05-13 10:10:46 
Re: Validating input file
jeff <jmoore207@[EMAIL  2008-05-13 07:19:17 
Re: Validating input file
"Rick Smith" &l  2008-05-13 11:22:00 
Re: Validating input file
Howard Brazee <howard@  2008-05-13 08:27:03 
Re: Validating input file
jeff <jmoore207@[EMAIL  2008-05-13 07:29:57 
Re: Validating input file
Howard Brazee <howard@  2008-05-13 09:05:10 
Re: Validating input file
Alain Reymond <arwebma  2008-05-13 17:15:12 
Re: Validating input file
"HeyBub" <he  2008-05-13 12:55:55 
Re: Validating input file
Howard Brazee <howard@  2008-05-13 09:44:30 
Re: Validating input file
"HeyBub" <he  2008-05-13 10:07:26 
Re: Validating input file
Howard Brazee <howard@  2008-05-13 09:20:32 
Re: Validating input file
jeff <jmoore207@[EMAIL  2008-05-13 08:12:00 
Re: Validating input file
"HeyBub" <he  2008-05-13 12:51:13 
Re: Validating input file
jeff <jmoore207@[EMAIL  2008-05-13 08:51:02 
Re: Validating input file
Howard Brazee <howard@  2008-05-13 10:17:53 
Re: Validating input file
"Rick Smith" &l  2008-05-13 12:46:06 
Re: Validating input file
jeff <jmoore207@[EMAIL  2008-05-13 09:21:54 
Re: Validating input file
jeff <jmoore207@[EMAIL  2008-05-13 10:03:50 
Re: Validating input file
"Rick Smith" &l  2008-05-13 13:38:03 
Re: Validating input file
jeff <jmoore207@[EMAIL  2008-05-13 10:07:31 
Re: Validating input file
jeff <jmoore207@[EMAIL  2008-05-13 10:42:37 
Re: Validating input file
"Rick Smith" &l  2008-05-13 14:24:42 
Re: Validating input file
"William M. Klein&qu  2008-05-13 23:14:07 
Re: Validating input file
Graham Hobbs <ghobbs@[  2008-05-13 21:37:46 
Re: Validating input file
Robert <no@[EMAIL PROT  2008-05-13 21:13:33 
Re: Validating input file
"William M. Klein&qu  2008-05-14 02:21:22 
Re: Validating input file
"Rick Smith" &l  2008-05-13 23:03:21 
Re: Validating input file
Robert <no@[EMAIL PROT  2008-05-13 21:35:08 
Re: Validating input file
Robert <no@[EMAIL PROT  2008-05-14 00:11:29 
Re: Validating input file
"Michael Mattias&quo  2008-05-14 08:38:24 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 22:06:22 CDT 2008.