Page 1 of 1
Field Numbers in Records in PDS
Posted: Mon Dec 01, 2014 5:53 am
by Gallium
Say there was a record in a PDS like this:
Do the spaces count as field numbers i.e. the 1 space between "G" and "L" and the many spaces between "5" and "H"?
Re: Field Numbers in Records in PDS
Posted: Mon Dec 01, 2014 8:31 am
by Robert Sample
"Field number" is not a term typically used as you have used it for sequential data sets (or PDS members). If you mean column numbers then the answer is that if you use ISPF View / Browse / Edit and see spaces between characters, each space represents one character and hence requires a column. If you mean something else, you will need to explain how you are using the term "field number". Spaces after the last character may or may not require columns -- depending upon the attributes of the data set and the specific EDIT options you used.
Re: Field Numbers in Records in PDS
Posted: Mon Dec 01, 2014 9:43 am
by steve-myers
"Fields," as such, are not a data set attribute. "Fields" in input data are specified by an application. In C, your input record might be defined by this structure -
Code: Select all
struct inrec
char field1[8],
char field2[8],
char rsv1[1],
char field3[11],
char rsv2[20],
char field4[4];
I think I got the syntax right; I don't use C very much any more. My field rsv2, for example, is the long sequence of blanks. Of course, you know your data - I hope you do - and your definition might well be different.
Re: Field Numbers in Records in PDS
Posted: Mon Dec 01, 2014 11:11 pm
by BillyBoyo
On the Mainframe, fields are fixed-length (with some exceptions). They are defined in programs.
If you want to treat that data as three fields, you could use Rexx (parse) or SORT (PARSE).
With fixed-length fields, things are much faster. When we need to do something else, we code for it.