× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.





Unlike in my mainframe days I've never seen a variable length file on the
AS400 (which always made sense to me since there is a relational database
underneath it all). And this warning seems to indicate that also:
RECORD clause gives range of record lengths. 506 will be used.

But regardless - are you saying you perform writes to the file and then
properly close it and there is no data in the file? When you try
interactive debugging does it show the writes are working (including
checking WS-FILE-STAT)?

Scott Lindstrom



|------------>
| From: |
|------------>
>----------------------------------------------------------------------------------------------------------------------------------------|
|<msmith6@xxxxxxxxxxxx> |
>----------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To: |
|------------>
>----------------------------------------------------------------------------------------------------------------------------------------|
|COBOL400-L@xxxxxxxxxxxx |
>----------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date: |
|------------>
>----------------------------------------------------------------------------------------------------------------------------------------|
|11/29/2010 01:02 PM |
>----------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject: |
|------------>
>----------------------------------------------------------------------------------------------------------------------------------------|
|[COBOL400-L] Variable length file |
>----------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Sent by: |
|------------>
>----------------------------------------------------------------------------------------------------------------------------------------|
|cobol400-l-bounces@xxxxxxxxxxxx |
>----------------------------------------------------------------------------------------------------------------------------------------|






I am trying to create a variable length file on the iSeries. The records
can vary from about 56 to 502 character with the average record length of
about 170 characters. I have to use DDS for this rather than SQL, so
here's my file description.

File is VARTEST
R VARRECORD
A fieldname 0502 VARLEN(56)


In the COBOL program

FILE-CONTROL.
SELECT VT
ASSIGN TO DATABASE-VARTEST
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS WS-FILE-STAT.

FD VT
RECORD CONTAINS 56 TO 504 CHARACTERS.
01 VARIABLE-REC.
COPY DDS-ALL-FORMATS OF VARTEST.

WORKING-STRAGE SECTION.
01 WS-REC-1 PIC X(55) VALUE "1".


PROCEDURE DIVISION
OPEN OUTPUT VT.

MOVE WS-REC-1 TO VARRECORD.
WRITE VARIABLE-REC.


CLOSE VT.

When I compile I get the following Warnings (not 'errors')
2 MSGID: LNC0810 SEVERITY: 10 SEQNBR: 000300

Message . . . . : Module name 'VARRECTST1' does not match
outermost
PROGRAM-ID name 'VARRECTST'. Accepted.

20 MSGID: LNC0852 SEVERITY: 0 SEQNBR: 001525

Message . . . . : RECORD clause gives range of record lengths. 506

will be used.

21 MSGID: LNC0853 SEVERITY: 20 SEQNBR: 001528

Message . . . . : Length 506 for record 'VARIABLE-REC' outside

specified range. Accepted.




I never get anything in the output file. Not sure if I have a stupid, D'oh
COBOL problem or if there is something unusual in the messages/variable
file that I'm not catching.


--
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing
list
To post a message email: COBOL400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/cobol400-l.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.