Field Numbers in Records in PDS

TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

Field Numbers in Records in PDS

Postby Gallium » Mon Dec 01, 2014 5:53 am

Say there was a record in a PDS like this:

12334231JHJVKGKG L6785956795                    HJ67

Do the spaces count as field numbers i.e. the 1 space between "G" and "L" and the many spaces between "5" and "H"?
Posts: 33
Joined: Tue Nov 25, 2014 10:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Field Numbers in Records in PDS


Re: Field Numbers in Records in PDS

Postby Robert Sample » Mon Dec 01, 2014 8:31 am

"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.
Robert Sample
Global moderator
Posts: 3099
Joined: Sat Dec 19, 2009 8:32 pm
Location: Bellevue, Iowa
Has thanked: 1 time
Been thanked: 176 times

Re: Field Numbers in Records in PDS

Postby steve-myers » Mon Dec 01, 2014 9:43 am

"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 -
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.
Global moderator
Posts: 1772
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 168 times

Re: Field Numbers in Records in PDS

Postby BillyBoyo » Mon Dec 01, 2014 11:11 pm

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.
Global moderator
Posts: 3734
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 254 times

Return to TSO & ISPF


  • Related topics
    Last post