Page 1 of 1

Print only selected fields in fileaid

PostPosted: Tue Apr 05, 2011 1:01 am
by needhelp
I am attempting to use the print option (Print file contents), then data file (1 Data File - Print the contents of a data file:
in formatted mode using record layout
in vertical formatted mode using record layout
in three-line hexadecimal mode
in single-line character mode ) in fileaid to print to a file.

Out of 328 fields, I only want to print 7 of them to the file. I am using vfmt, record layout, and selection criteria. In addition to my values I am selecting I am also doing a DISPLAY of the fields I want to keep.

The fields I want to keep show up when I do 'DISPLAY 2,4,31,33,38,39,105 ONLY', when building the selection criteria, but when I submit the job to print to a file, ALL the fields are being written to the file. How do I get ONLY the fields I want to print to the file, or can it not be done in fileaid?

Re: Print only selected fields in fileaid

PostPosted: Tue Apr 05, 2011 9:38 pm
by mprobst
If you are using VFMT you can simply enter VPRINT and the number of records you would like to print. As in: VPRINT 10 to print the next 10 records from your current position in the file.
The same works in FMT mode only you would use FPRINT 10.

Re: Print only selected fields in fileaid

PostPosted: Tue Apr 05, 2011 10:26 pm
by needhelp
It's not the number of records that is the issue, it is the number of fields within the record. I am getting all the records, but I want only 7 of the fields, not all 328.

Re: Print only selected fields in fileaid

PostPosted: Wed Apr 06, 2011 12:53 am
by Robert Sample
VPRINT FIELDS=(2,4,31,33,38,39,105)
will work as long as you've defined the layout properly.

Re: Print only selected fields in fileaid

PostPosted: Wed Apr 06, 2011 1:54 am
by mprobst
If you are doing this thru ISPF, and you have your 7 fields narrowed down by entering 'DISPLAY 2,4,31,33,38,39,105 ONLY'
THEN use VPRINT with the number of records you would like to print and it will cause only the 7 fields for that many records to print.
(it works the same way in formated mode. The only difference is FPRINT vs VPRINT)

Re: Print only selected fields in fileaid

PostPosted: Wed Apr 06, 2011 3:18 am
by needhelp
Thank you Robert Sample. That was the syntax I was looking for. I had to modify the JCL that fileaid created to add this to it.
//SYSIN DD *
$$DD01 VPRINT SHOW=FORMAT,LAYOUT=XXXXXX,TRUNC=NO,
FILLER=ON,ZERO=OFF,FIELDS=(2,4,31,33,38,39,105)
/*