|
|
| Author |
Message |
sandhyarenu
New User
Joined: 04 Jan 2007 Posts: 16 Location: India
|
|
|
|
| Got another Qn. I have an input file that is fed to the assembler program. The file is in character format. How do I get the contents of the file displayed ? Or for that matter, how do I display the content of any variable in the program ? WTO, I understand will display only the charcaters specified inside quotes, correct ? Kindly suggest. |
|
| Back to top |
|
 |
References
|
|
 |
GAFUR
New User
Joined: 19 May 2005 Posts: 32
|
|
|
|
load that variable data into any work register by using Load instruction and issue CVD instruction then do UNPK and OI.
Also, Instead of using WTO you can write into any SYSPRINT file after OI instruction.
L 4,WSFW
CVD 4,WSDW
UNPK MSG+2(16),WSDW
OI MSG+17,X'F0'
LA 3,MSG
WTO TEXT=(3)
****
MSG DC AL2(16)
DS CL(16)
WSDW DS D
WSFW DC F'2345' |
|
| Back to top |
|
 |
GAFUR
New User
Joined: 19 May 2005 Posts: 32
|
|
|
|
| Please note that the code mentioned in above post is to display binary data. |
|
| Back to top |
|
 |
sandhyarenu
New User
Joined: 04 Jan 2007 Posts: 16 Location: India
|
|
|
|
| Thanks ! But my input file is a character/Hexadecimal file. Would the above code be applicable to that too ? If not, what's the way to go ? |
|
| Back to top |
|
 |
GAFUR
New User
Joined: 19 May 2005 Posts: 32
|
|
|
|
Yes but remove the instruction L ,CVD ,UNPK and OI which will give you convert binary data to character form.
I tested a sample code qiuckly this will display a variable which is having charcter data. Hope it will be useful.
assuming VAR1 is a variable in the file having character data.
MVC MSG+2(L'VAR1),VAR1
LA 3,MSG
WTO TEXT=(3)
MSG DC AL2(LEN)
DS CL10
LEN EQU *-MSG-2
VAR1 DC C'HELLO' |
|
| Back to top |
|
 |
sandhyarenu
New User
Joined: 04 Jan 2007 Posts: 16 Location: India
|
|
|
|
| ok ! But If Var1 is a field in the file, why have we initialised it to to HELLO in the code ? |
|
| Back to top |
|
 |
GAFUR
New User
Joined: 19 May 2005 Posts: 32
|
|
|
|
Its for only testing . If you read the file successfully into the file layout use the fields whichever you want in place of VAR1.
No need to intialize. |
|
| Back to top |
|
 |
GAFUR
New User
Joined: 19 May 2005 Posts: 32
|
|
|
|
| Also i have assumed the max length of the field which is going to display is 10 bytes. you can change this in DS CL10 instruction to any value as you wish. |
|
| Back to top |
|
 |
sandhyarenu
New User
Joined: 04 Jan 2007 Posts: 16 Location: India
|
|
|
|
Alright GAFUR, will try out ! Thanks a bunch !  |
|
| Back to top |
|
 |
Splitted: Thu Jun 05, 2008 10:40 pm by dick scherrer From Topic How to dynamically allocate/deallocate a QSAM File? (PL/I & ASSEMBLER) |
|
|