Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

File Manager with Variable Length File

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IBM Tools
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    Post subject: File Manager with Variable Length File
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: 1238
Location: Richfield, MN, USA

PostPosted: Fri Apr 01, 2016 12:12 am    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Apr 01, 2016 1:05 pm    Post subject:
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    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Apr 01, 2016 10:02 pm    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Fri Apr 01, 2016 10:04 pm    Post subject:
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    Post subject:
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    Post subject:
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: 1715
Location: UK

PostPosted: Sat Apr 02, 2016 2:39 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Sat Apr 02, 2016 2:59 pm    Post subject:
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: 1715
Location: UK

PostPosted: Sat Apr 02, 2016 7:20 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> IBM Tools All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us