Page 2 of 3

Re: Help with Data Selection in PIC Field

PostPosted: Fri Jul 30, 2010 11:12 pm
by Robert Sample
Glad to hear it worked.

Re: Help with Data Selection in PIC Field

PostPosted: Wed Aug 11, 2010 5:09 am
by crazycobol
didn't want to start another thread so I'll ask it in here. Its probably something really simple but I can't seem to understand it.

I am trying to conform to a particular layout. At the end of the data there are spaces filled. I can't get the spaces.

Example:

10 disk-name PIC x(05).
10 disk-address PIC x(10).
10 Filler Pic x(10).


When I have that, it will not give me the 10 spaces.

However if I do the same thing except add a statement at the end such as:

10 disk-name PIC x(05) value spaces.
10 disk-address PIC x(10) value spaces.
10 Filler Pic x(10) value spaces.
10 disk-fill x.


Move "|" to disk-fill.

It will create the spaces. So the data will be

"namesaddresses1 |"

(without the quotation marks)

How do I get it so there are 10 spaces so I don't have to add the extra character.

Thanks for the help

Re: Help with Data Selection in PIC Field

PostPosted: Wed Aug 11, 2010 6:18 am
by dick scherrer
Hello,

The spaces have always been there . . .

Moving a | simply made the spaces visable because it put "something" to the right of the 10 spaces.

Why did you think the spaces were not there?

Re: Help with Data Selection in PIC Field

PostPosted: Wed Aug 11, 2010 6:19 am
by Robert Sample
Your two code segments differ -- the FILLER has VALUE SPACES in one, not in the other.

Is this part of an FD 01 or WORKING-STORAGE variable?

What are you seeing in the FILLER instead of spaces?

Re: Help with Data Selection in PIC Field

PostPosted: Wed Aug 11, 2010 9:24 pm
by crazycobol
I don't see any spaces if I bring the exported file to a text editor. It has a carriage return.

When I view the file it looks like this:

"namesaddresses1"
"namesaddresses2"
"namesaddresses3"

I would like it to show the spaces:

"namesaddresses1............"
"namesaddresses2............"
"namesaddresses3............"

(the period represent spaces)

Re: Help with Data Selection in PIC Field

PostPosted: Wed Aug 11, 2010 10:19 pm
by NicC
If you move to a PC to edit the file then it is quite likely that trailing blanks will be dropped unless you specify that they are to be kept. PC editors use CRLF to detect end of line not LRECL. You have to check it out on the mainframe in ISPF.

Re: Help with Data Selection in PIC Field

PostPosted: Wed Aug 11, 2010 10:27 pm
by crazycobol
how do I go about keeping the trailing blanks? do I insert a CRLF into the file?

Re: Help with Data Selection in PIC Field

PostPosted: Wed Aug 11, 2010 10:35 pm
by Robert Sample
If the file is fixed length, every record will be the same length -- if shorter, it will generally be padded to the record length with spaces to the right. Whether or not you see these spaces depends upon which editor you use and what you do to get the file to the editor.

If the file is variable length, the trailing spaces will be there if you put them there. Whether or not you see these spaces depends upon which editor you use and what you do to get the file to the editor.

For example, if you FTP the file from the mainframe to your PC, then open it with a PC editor -- the spaces may not be there anymore since FTP has an option to remove trailing spaces from each record while transferring them. The spaces are still in the file on the mainframe, of course, but you cannot see them due to the way you transferred the file to your editor.

Re: Help with Data Selection in PIC Field

PostPosted: Wed Aug 11, 2010 11:27 pm
by crazycobol
thanks for the response.

It is a fixed length record. I'm not ftp-ing the file. When the program is creating the file, it is being created on a local drive.

Re: Help with Data Selection in PIC Field

PostPosted: Wed Aug 11, 2010 11:58 pm
by Robert Sample
Local drive? Would this, by any chance, be a Micro Focus COBOL compile?