IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

File Manager with Variable Length File


IBM Mainframe Forums -> IBM Tools
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ahabib

New User


Joined: 31 Mar 2016
Posts: 3
Location: United States

PostPosted: Thu Mar 31, 2016 11:00 pm
Reply with quote

I'm trying to figure out if it is possible to use File Manager to view a variable length file formatted. The file is comprised of 11 copy books with different occurrences. In section 1 there are fields that determine how many occurrences of the other sections are present. I tried looking around and couldn't really find anything. Any suggestions?


Example:
05 FILE-SECTION-1. --LENGTH: 1800
10 SECTION-2-OCCURS
10 SECTION-3-OCCURS
10 SECTION-4-OCCURS
10 SECTION-5-OCCURS
10 SECTION-6-OCCURS
10 SECTION-7-OCCURS
10 SECTION-8-OCCURS
10 SECTION-10-OCCURS
10 SECTION-11-OCCURS
05 FILE-SECTION-2 OCCURS 7 TIMES --LENGTH: 2800
05 FILE-SECTION-3 OCCURS 6 TIMES --LENGTH: 900
05 FILE-SECTION-4 OCCURS 6 TIMES --LENGTH: 600
05 FILE-SECTION-5 OCCURS 15 TIMES --LENGTH: 1500
05 FILE-SECTION-6 OCCURS 6 TIMES --LENGTH: 7800
05 FILE-SECTION-7 OCCURS 25 TIMES --LENGTH: 750
05 FILE-SECTION-8 OCCURS 8 TIMES --LENGTH: 440
05 FILE-SECTION-9. --LENGTH: 375
05 FILE-SECTION-10 OCCURS 10 TIMES --LENGTH: 750
05 FILE-SECTION-11 OCCURS 30 TIMES --LENGTH: 3000
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Fri Apr 01, 2016 12:12 am
Reply with quote

Please use Code tags to preserve correct spacing:
Code:
05 FILE-SECTION-1. --LENGTH: 1800
 10 SECTION-2-OCCURS
 10 SECTION-3-OCCURS
 10 SECTION-4-OCCURS
 10 SECTION-5-OCCURS
 10 SECTION-6-OCCURS
 10 SECTION-7-OCCURS
 10 SECTION-8-OCCURS
 10 SECTION-10-OCCURS
 10 SECTION-11-OCCURS
 05 FILE-SECTION-2 OCCURS 7 TIMES --LENGTH: 2800
 05 FILE-SECTION-3 OCCURS 6 TIMES --LENGTH: 900
 05 FILE-SECTION-4 OCCURS 6 TIMES --LENGTH: 600
 05 FILE-SECTION-5 OCCURS 15 TIMES --LENGTH: 1500
 05 FILE-SECTION-6 OCCURS 6 TIMES --LENGTH: 7800
 05 FILE-SECTION-7 OCCURS 25 TIMES --LENGTH: 750
 05 FILE-SECTION-8 OCCURS 8 TIMES --LENGTH: 440
 05 FILE-SECTION-9. --LENGTH: 375
 05 FILE-SECTION-10 OCCURS 10 TIMES --LENGTH: 750
 05 FILE-SECTION-11 OCCURS 30 TIMES --LENGTH: 3000
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Apr 01, 2016 1:05 pm
Reply with quote

Check the RDW for its length.
Back to top
View user's profile Send private message
ahabib

New User


Joined: 31 Mar 2016
Posts: 3
Location: United States

PostPosted: Fri Apr 01, 2016 9:19 pm
Reply with quote

How would that help to display the file formatted? The RDW will only tell me how large the file is, it won't help to find out how many (if any) occurrences of each copybook there are. Unless there is a way to create a template in File Manager that can read a multiple fields to determine the formatting.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Apr 01, 2016 10:02 pm
Reply with quote

Well, that is new for me the RDW telling how large the file is. Maybe its time for you to do some learning about variable length records.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Fri Apr 01, 2016 10:04 pm
Reply with quote

The manual doesn't particularly note any problems with what you want to do:
Quote:
Support for variable-length arrays
A variable-length array is defined in a COBOL copybook by an OCCURS
DEPENDING ON (ODO) clause, and in a PL/I copybook by a dimension attribute
where the lower or upper bounds (or both) are defined by REFER options, or
when a PL/I string data type has a REFER variable for the declared length, for
example, CHAR(expr REFER name).
The following considerations apply when using a template that contains
variable-length arrays:
v A record structure can contain multiple variable-length arrays; however, the
fields that define the size of the arrays (the ODO or REFER “objects”) must all
appear in the record prior to the first variable-length array item, or, in the case
of PL/I REFER length, prior to the first string declared with a REFER length.
v If any of the following are true:
– (COBOL copybook only.) The object is out of the range specified by the ODO
clause.
– The actual record length does not match the calculated length of a record
with the number of array items specified by the object.
– (PL/I copybook only.) The record length does not match the calculated length
of a record based on both string length REFERs and number of dimension
extents calculated from the lower and upper bound REFERS for each
dimension of an array.
When editing the data set, the prefix area contains the description =LGTH,
indicating that the record was not selected because of invalid length. (To
show these records, rather than hiding them with other “not selected”
records, select the Length error option on the Edit/Browse Options (option
0.8) panel.)
v In SNGL or TABL display format:
– You can change the length of a record by changing the value of an object
field. This is an exception to the rule that the length of a record cannot be
altered in an Edit session, without using ZOOM.
– When you change the value of an object field, then the number of items in
the array expands or contracts automatically.
New items are inserted at the end of the current array (and before any fields
that follow the array); numeric items are initialized to zero and alphanumeric
items are initialized to blanks.
Similarly, items are deleted from the end of the array, and any fields
subsequent to the end of the array are not affected.
For PL/I, the number of items in an array is determined by subtracting the
lower bound of the dimension attribute from the upper bound and then
adding one. If any REFER variables (fields) are specified as a lower or upper
bound of an array dimension, then changing the value of any REFER object
field inserts or deletes array items accordingly. For the TABL Format, if the
new number of array items exceeds the current number of TABL columns for
the array, File Manager expands the number of columns in the display and
adds new column headings. Similarly, if a PL/I string length REFER is
changed, the column width in TABL for each variable using that REFER is
changed.
– (COBOL copybook only.) File Manager does not allow you to change the
object field to a value outside the range specified by the ODO clause (File
Manager supports an ODO lower value of 0.)
Template types and structure
142 File Manager for z/OS V13R1 User's Guide
– (COBOL copybook only.) Inserting a new record results in a record with the
minimum number of array items specified by the ODO definition. For
example, given the following ODO clause:
ODO-ONE OCCURS 0 TO 10 TIMES DEPENDING ON ODO-CNTRL-ONE.
then, when you insert a new record, the ODO-CNTRL-ONE field is initialized
to zero, and there are no ODO-ONE array items in the new record.
Given the following ODO clause:
ODO-ONE OCCURS 5 TO 7 TIMES DEPENDING ON ODO-CNTRL-ONE.
then ODO-CNTRL-ONE is initialized to 5, and there are five ODO-ONE array
items in the new record.
– (PL/I copybook only.) Inserting a new record using a template that contains
REFER specifications results in one element for each array dimension. Upper
and lower bound REFER values are set to one.
v In CHAR, HEX or LHEX display format, changing the value of an object field
does not change the record length. In these display formats, changing the value
of an object field can result in a mismatch between the object field value and the
calculated length of the record with that many array items.
Back to top
View user's profile Send private message
ahabib

New User


Joined: 31 Mar 2016
Posts: 3
Location: United States

PostPosted: Fri Apr 01, 2016 10:22 pm
Reply with quote

PeterHolland wrote:
Well, that is new for me the RDW telling how large the file is. Maybe its time for you to do some learning about variable length records.


Does an RDW not determine the length of a variable length file?

Quote:
"A variable-length logical record consists of a 4-byte record descriptor word (RDW) followed by the data. The first 2 bytes contain the length of the logical record. The last 2 bytes must be 0 because these are used for spanned records"
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Fri Apr 01, 2016 11:47 pm
Reply with quote

No, it tells you the length of the variable record you just read in the file
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Apr 02, 2016 2:39 pm
Reply with quote

And it is not 'file' but 'dataset'. They are two different things.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Sat Apr 02, 2016 2:59 pm
Reply with quote

Quote:
And it is not 'file' but 'dataset'. They are two different things.


Its not different, its just a naming preferred by IBM.

Anything to say on topic?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Apr 02, 2016 7:20 pm
Reply with quote

They are different - datasets contain control info within the dataset, inter-block gaps etc.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> IBM Tools

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top