Page 2 of 2

Re: Xread, Xdeic

PostPosted: Tue Aug 31, 2010 5:52 am
by dick scherrer
You're welcome.

You might try inserting an XPRNT immediately after the XREAD and see if the first input record is printed. . .

If this code worked properly, what would be the output?

Re: Xread, Xdeic

PostPosted: Tue Aug 31, 2010 5:53 am
by Robert Sample
Boy, the memories -- I had to learn assembler without ASSIST but ran across it early on. I've always liked it, despite its big drawbacks.

Have you tried:
//xxxxxxxx JOB ,'belkin 99     ',MSGCLASS=H         
//STEP01 EXEC PGM=ASSIST,PARM='MACRO=F'             
//STEPLIB DD DSN=xxxxxxx.ASSIST.LOADLIB,DISP=SHR   
//SYSIN DD *                                       
          XREAD CARD,80               
CHECKEOF BC    B'0100',EXIT         
          XDECI 2,CARD               
          XDUMP                       
          BC    B'1110',VALIDNUM     
          XPRNT BADNUM,29             
          BC    B'1111',EXIT         
VALIDNUM XDECO R2,OUTPUT             
          XPRNT OUTPUT,81   
//CARD DD *
.
.
.

Re: Xread, Xdeic

PostPosted: Tue Aug 31, 2010 9:41 am
by steve-myers
I know almost nothing about Assist, but your code looks not so valid to me.

In XREAD, does CARD represent a data area (which does not appear to be defined in your code), or a DD statement. If it's a DD statement, then where is XREAD reading the data? Or is it returning the address of a data area?

The use of a mask in BC instructions is most unusual, though it's perfectly valid. Most of us have to dig deep into our memory banks to interpret B'0100', or B'1110' for that matter. B'1111', at least, is easy.

In "regular" Assembler, most macros do not set or preserve the condition code, so I have to wonder about the BC after XREAD, or, for that matter, the BC after XDUMP. I have one programmer macro I use in my own code that sets the condition code, but the only reliable BC masks after the macro would be B'1000' or B'0111'. B'0100' or B'0010' would not be reliable even though the macro is supposed to be doing a compare.

The OUTPUT data area specified in XDECO and XPRNT does not appear to be defined

EXIT is not defined.

Re: Xread, Xdeic

PostPosted: Thu Sep 02, 2010 7:33 am
by belkin99
Guys thanks for the Help,

I figured the problem
In simple words, XREAD read 80 bytes as maximum, input record, from in-stream data or DD as a CHAR.

So, Using XDEIC will convert first number from input record, CHAR to Binary ,and to get the second number from the input record, 80 bytes that has been read, we use
Xdeic r,0(,1)
AND TO READ the third number of the the input record, XDEIC r,0(,1) again
continue with this till the end of the input record.

The numbers in r are a binary and you can use them for math operation

To convert the number back to decimal use XDECO

So, following these steps I got the correct answers
I consider this issue has been solved
Thanks,
:)

Re: Xread, Xdeic

PostPosted: Thu Sep 02, 2010 9:11 am
by dick scherrer
Good to hear it is working - thank you for letting us know and posting the resolution :)

d