Field Numbers in Records in PDS

TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...
Gallium
Posts: 33
Joined: Tue Nov 25, 2014 10:07 pm
Skillset: Student on Computer Science Course
Referer: Google

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:

Code: Select all

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"?

Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
Referer: other forum
Location: Dubuque, Iowa, USA

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.

steve-myers
Global moderator
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Skillset: Assembler, JCL, utilities
Referer: zos.efglobe.com

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 -

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.

BillyBoyo
Global moderator
Posts: 3805
Joined: Tue Jan 25, 2011 12:02 am
Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
Referer: Google

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.


  • Similar Topics
    Replies
    Views
    Last post