Printing Files



High Level Assembler(HLASM) for MVS & VM & VSE

Printing Files

Postby RISCCISCInstSet » Fri Dec 07, 2012 2:12 am

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
RISCCISCInstSet
User avatar
RISCCISCInstSet
 
Posts: 121
Joined: Mon Oct 17, 2011 1:46 pm
Has thanked: 146 times
Been thanked: 0 time

Re: Printing Files

Postby dick scherrer » Fri Dec 07, 2012 2:58 am

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.
Hope this helps,
d.sch.

These users thanked the author dick scherrer for the post:
RISCCISCInstSet (Fri Dec 07, 2012 3:52 am)
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Printing Files

Postby steve-myers » Fri Dec 07, 2012 4:54 am

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..

These users thanked the author steve-myers for the post:
RISCCISCInstSet (Fri Dec 07, 2012 4:55 am)
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Printing Files

Postby RISCCISCInstSet » Fri Dec 07, 2012 5:10 am

Locate the first ,

There's my problem - I can't do that. Can you tell me how to locate commas?
RISCCISCInstSet
User avatar
RISCCISCInstSet
 
Posts: 121
Joined: Mon Oct 17, 2011 1:46 pm
Has thanked: 146 times
Been thanked: 0 time

Re: Printing Files

Postby RISCCISCInstSet » Fri Dec 07, 2012 5:35 am

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. :)
RISCCISCInstSet
User avatar
RISCCISCInstSet
 
Posts: 121
Joined: Mon Oct 17, 2011 1:46 pm
Has thanked: 146 times
Been thanked: 0 time

Re: Printing Files

Postby BillyBoyo » Fri Dec 07, 2012 5:38 am

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.

These users thanked the author BillyBoyo for the post:
RISCCISCInstSet (Fri Dec 07, 2012 5:48 am)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Printing Files

Postby RISCCISCInstSet » Fri Dec 07, 2012 5:52 am

@BillyBoyo thanks - I think that was really helpful. :D
RISCCISCInstSet
User avatar
RISCCISCInstSet
 
Posts: 121
Joined: Mon Oct 17, 2011 1:46 pm
Has thanked: 146 times
Been thanked: 0 time

Re: Printing Files

Postby steve-myers » Fri Dec 07, 2012 8:02 am

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.

These users thanked the author steve-myers for the post:
RISCCISCInstSet (Fri Dec 07, 2012 8:22 am)
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times


Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post