Page 1 of 1

Printing Files

PostPosted: Fri Dec 07, 2012 2:12 am
by RISCCISCInstSet
I currently need to go through a file and print out its characters excluding those from going from a comma to an end of a line.
What types of instructions do I need for this - I'm confused.
Thanks

Re: Printing Files

PostPosted: Fri Dec 07, 2012 2:58 am
by dick scherrer
Hello,

You request is quite unclear . . .

Suggest you show some "input" data and the output you want after your code has done what you want. Use the Code tag.

Without seeing any data what i can say is that you need to:
Identify the point from which you want to "space out" the remainder of the area,
Move spaces from that point thru the remainder of the area.

Re: Printing Files

PostPosted: Fri Dec 07, 2012 4:54 am
by steve-myers
First of all, a "file" in MVS is the data on a section of magnetic tape from the beginning of the tape to a file mark, or the data on a section of magnetic tape between two file marks. Period. End of story. Use the correct terminology.

Second, you have not discussed the characteristics of this "file," or the output. What are the RECFM, LRECL and BLKSIZE.

Your program logic will be something like this:

LOOP: read a record from the input
Locate the first ,
Copy the data from the beginning of the input to the byte before the first , to the output area
Set the remainder of the output area to blanks
Write the output data
Branch to LOOP

If it is code you want, I'm sure there are people that can assist you for an appropriate fee..

Re: Printing Files

PostPosted: Fri Dec 07, 2012 5:10 am
by RISCCISCInstSet
Locate the first ,

There's my problem - I can't do that. Can you tell me how to locate commas?

Re: Printing Files

PostPosted: Fri Dec 07, 2012 5:35 am
by RISCCISCInstSet
There's my problem - I can't do that. Can you tell me how to locate commas?
Maybe I'm asking for code, which you didn't seem want to do. I think I can likely resolve this myself. :)

Re: Printing Files

PostPosted: Fri Dec 07, 2012 5:38 am
by BillyBoyo
You test the first byte. If that is not a comma, you test the next. You continue until you reach a comma or the end of the field. You do one thing if you find a comma, another if you don't.

Lot's of ways to achieve that. Get one working and show it. Remember, you have a lump of data, which starts at a particular address, and has a length. You want to start at a particular address (the same one) and only use a length of one. Then you want to look at address+1 and look at it for a length of one, and continue like that. Set your TIME to (,1), you'll get S322s or S0C4s, I bet, but you'll know why - you've run off the end, so just let the system chop it and concentrate on why you've run off the end.

Re: Printing Files

PostPosted: Fri Dec 07, 2012 5:52 am
by RISCCISCInstSet
@BillyBoyo thanks - I think that was really helpful. :D

Re: Printing Files

PostPosted: Fri Dec 07, 2012 8:02 am
by steve-myers
BillyBoyo wrote:You test the first byte. If that is not a comma, you test the next. You continue until you reach a comma or the end of the field. You do one thing if you find a comma, another if you don't.

Lot's of ways to achieve that. ...
Or try to write the code any way, post it here it here along with whatever diagnostic data you can muster, and someone should be able to assist you.