Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to display file contents

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
sandhyarenu

New User


Joined: 04 Jan 2007
Posts: 16
Location: India

PostPosted: Thu Jun 05, 2008 3:49 pm    Post subject:
Reply with quote

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
View user's profile Send private message

GAFUR

New User


Joined: 19 May 2005
Posts: 31

PostPosted: Thu Jun 05, 2008 4:28 pm    Post subject:
Reply with quote

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
View user's profile Send private message
GAFUR

New User


Joined: 19 May 2005
Posts: 31

PostPosted: Thu Jun 05, 2008 4:35 pm    Post subject:
Reply with quote

Please note that the code mentioned in above post is to display binary data.
Back to top
View user's profile Send private message
sandhyarenu

New User


Joined: 04 Jan 2007
Posts: 16
Location: India

PostPosted: Thu Jun 05, 2008 5:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
GAFUR

New User


Joined: 19 May 2005
Posts: 31

PostPosted: Thu Jun 05, 2008 5:30 pm    Post subject:
Reply with quote

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
View user's profile Send private message
sandhyarenu

New User


Joined: 04 Jan 2007
Posts: 16
Location: India

PostPosted: Thu Jun 05, 2008 5:37 pm    Post subject:
Reply with quote

ok ! But If Var1 is a field in the file, why have we initialised it to to HELLO in the code ?
Back to top
View user's profile Send private message
GAFUR

New User


Joined: 19 May 2005
Posts: 31

PostPosted: Thu Jun 05, 2008 5:52 pm    Post subject:
Reply with quote

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
View user's profile Send private message
GAFUR

New User


Joined: 19 May 2005
Posts: 31

PostPosted: Thu Jun 05, 2008 5:57 pm    Post subject:
Reply with quote

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
View user's profile Send private message
sandhyarenu

New User


Joined: 04 Jan 2007
Posts: 16
Location: India

PostPosted: Thu Jun 05, 2008 6:30 pm    Post subject:
Reply with quote

Alright GAFUR, will try out ! Thanks a bunch ! icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 0 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Display ZEDLMSG without Pressing F1 &... anandgbe CLIST & REXX 8 Thu Dec 15, 2016 4:20 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us