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 SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm


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