IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Instruction in Assembler to initialise variables


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ssamineni
Warnings : 1

New User


Joined: 10 Mar 2007
Posts: 16
Location: India

PostPosted: Mon Jun 11, 2007 1:09 pm
Reply with quote

Hi,

Is there any instruction in Assembler to initialise variables?..

We need to initialise the map before we populate the values,currently we are moving spaces to each and every variable of map.is ther any other way to initialise any DSECT?
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Jun 11, 2007 1:43 pm
Reply with quote

ssamineni,

Did you try DC instruction?
Back to top
View user's profile Send private message
ssamineni
Warnings : 1

New User


Joined: 10 Mar 2007
Posts: 16
Location: India

PostPosted: Mon Jun 11, 2007 5:27 pm
Reply with quote

I want to inidiatliase the whole dsect in my logic of the program.I think DC can be used to intialise a single variable.Please correct me if am wrong
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Jun 11, 2007 5:31 pm
Reply with quote

ssamineni,

Quote:
I want to inidiatliase the whole dsect in my logic of the program


I dont think its possible.

Quote:
I think DC can be used to intialise a single variable.Please correct me if am wrong


Yes you are correct.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jun 11, 2007 6:46 pm
Reply with quote

ssamineni wrote:
Is there any instruction in Assembler to initialise variables?..
We need to initialise the map before we populate the values,currently we are moving spaces to each and every variable of map.is ther any other way to initialise any DSECT?
What map fields do you want to initialize?
What do you want to initialize them to?
Back to top
View user's profile Send private message
ssamineni
Warnings : 1

New User


Joined: 10 Mar 2007
Posts: 16
Location: India

PostPosted: Mon Jun 11, 2007 7:25 pm
Reply with quote

In my CICS Assembler program,I have to intialise my BMS MAP variables before i populate the values. Currently we are initialising the variables by moving spaces in logic of the program. I am looking for some other option which can intialise the MAp rataher than individual fields
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jun 11, 2007 10:59 pm
Reply with quote

I don't think so, Usually the fields are left low-values unless you want something in them, and movint that value does not need spaces before hand.
You can move low-values to the map group name but not spaces, that would mess up the other map fields.
Back to top
View user's profile Send private message
ssamineni
Warnings : 1

New User


Joined: 10 Mar 2007
Posts: 16
Location: India

PostPosted: Tue Jun 12, 2007 9:49 am
Reply with quote

Thanks for the reply.

"You can move low-values to the map group name but not spaces, that would mess up the other map fields"

Could you please let me know how to do this?
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Tue Jun 12, 2007 5:32 pm
Reply with quote

Hi !

Use this little example to clear a mapset.

Regards, UmeySan

LA R14,MAPSET ...Load Map-Adress
LA R15,MAPLNG ...Load Map-Length

If MapLength not greater 256, you could use the EX-Instruction
to clear the whole Map. Otherwise you have to code a little Loop.

If MapLength not greater 256

...BCTR R15,0
...EX R15,XCMAP

...XCMAP XC 0(0,R14),0(R14)

End-If


If MapLength greater 256
Loop
...clear the first 256,bytes
...check for the rest
...clear the next bytes
End-Loop
End-If
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Jun 12, 2007 5:38 pm
Reply with quote

I would think an overlapping MVCL would be easier......
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Thu Jun 14, 2007 1:22 pm
Reply with quote

May be...

many ways leading to rome !!!
Back to top
View user's profile Send private message
ganeshptrk

New User


Joined: 04 Apr 2007
Posts: 17
Location: Chennai

PostPosted: Mon Jun 25, 2007 7:36 pm
Reply with quote

Firstly, you cannot have DC in a DSECT. Even if you have DC, the assembler will take the declare as DS.

So to initialize all the contents of a DSECT, you to have do it in the program where you are establishing the addressability with this DSECT.
You can use MVC if the total no.of bytes is <=256 bytes, else MVCL
Back to top
View user's profile Send private message
ssrinath22
Warnings : 2

New User


Joined: 08 Mar 2007
Posts: 7
Location: chennai

PostPosted: Sun Jul 01, 2007 4:40 pm
Reply with quote

any of thempls send me any sample programs of assembler........i wiould be thankful ..........my id is e-mail id removed
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Jul 01, 2007 5:26 pm
Reply with quote

Hello and welcome to the forums,

When posting, please check your spelling. I don't know what this "any of thempls" is.

Also, it is against forum policy to post your e-mail address - there have been many p[roblems with spammers.

If you are working an assembler module and have questions, post them here and we may be able to offer suggestions.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts JCL with variables JCL & VSAM 1
No new posts Getting SOC4 while calling a Cobol DB... PL/I & Assembler 4
No new posts Passing parm from JCL to Assembler, b... PL/I & Assembler 2
No new posts Assembler class assignment: stuck on ... PL/I & Assembler 12
No new posts Assembler: Set Program Mask for decim... PL/I & Assembler 4
Search our Forums:

Back to Top