MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem in Assembler Coding.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Kautilya
Beginner


Joined: 24 Jan 2004
Posts: 8
Topics: 2

PostPosted: Fri Dec 30, 2005 4:28 am    Post subject: Problem in Assembler Coding. Reply with quote

Right now I am writing an assembler program to find the record length, starting point and length of key and number of records in VSAM using SHOWCB. The values are obtained in a variable DSP which is 4F. I am then using DSECT DSP1 and then getting the lengths in variable L1, L2, L3 and L4. After that I am trying to convert the L1, L2, L3 and L4 to zoned decimal format. But when I execute the line "CVD 3,PKD" the value of L4 is getting changed. On debugging in intertest and found out that PKD is overlapping the memory occupied by L4. I have tried different methods to overcome this but everthing is failing. Any idea what I need to do. Please Advice.

Code:


DSP1     DSECT           
L1       DS    F         
L2       DS    F         
L3       DS    F         
L4       DS    F         
DATASET  DSECT           
DSNAME   DS    CL44     
ALLOC5   START           
         SAVE  (14,12)   
         BALR  12,0     
         USING *,12     
         B     START1   
.
.
.
SPARA    SHOWCB ACB=BLOCK,AREA=DSP,FIELDS=(KEYLEN,NLOGR,RKP,LRECL),    X
               LENGTH=16                                               
         LTR   15,15                                                   
         BZ    NOERR1                                                   
         MVC  DSNAME1,=CL44' '                                         
         MVC  DSNAME1(22),=C'ERROR: ERROR IN SHOWCB'                   
         B     ENDPGM                                                   
NOERR1   L     4,=A(DSP)                                             
          USING DSP1,4
          L       3,L1                                                     
         CVD   3,PKD                                                   
         MVC   DSNAME1,=CL44' '                                         
         MVC  DSNAME1,=X'40212020202020202020202020202020'             
.
.
.
.
DSP      DS    4F
PKD      DS    PL8






Regards
Praveen
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Fri Dec 30, 2005 11:36 am    Post subject: Reply with quote

Perhaps addresability to PKD is messed up by the USING for DSP. Move the DSP fields to the end (after PKD).
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
Kautilya
Beginner


Joined: 24 Jan 2004
Posts: 8
Topics: 2

PostPosted: Sat Dec 31, 2005 4:05 am    Post subject: Reply with quote

Hi Bill,

I just tried out that but it isn't working.

Regards
Praveen
Back to top
View user's profile Send private message
Kautilya
Beginner


Joined: 24 Jan 2004
Posts: 8
Topics: 2

PostPosted: Sat Dec 31, 2005 4:05 am    Post subject: Reply with quote

Hi Bill,

I just tried out that but the result remains the same.

Regards
Praveen
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Sat Dec 31, 2005 11:48 am    Post subject: Reply with quote

Praveen,
I think you need to show a little more of your program. In particular, show the few lines before DSP and after PKD. Where are BLOCK and DSNAME1 for example?
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Thu Jan 05, 2006 8:35 am    Post subject: Reply with quote

Code:

NOERR1   LA     4,DSP


Also the correct way to initialise a buffer is like this:

Code:

          MVI   DSNAME,C' '                         
          MVC  DSNAME+1(L'DSNAME-1),DSNAME 

_________________
Dave Crayford


Last edited by DaveyC on Thu Jan 05, 2006 8:58 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Thu Jan 05, 2006 8:46 am    Post subject: Reply with quote

Dave,
Your way uses fewer bytes of memory but it's not necessarily the "correct" way.

Praveen,
Why clear DSNAME1 first if you're going to move an EDIT mask into it? Is the EDIT mask a full 44 bytes?
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.


Last edited by Bill Dennis on Thu Jan 05, 2006 8:57 am; edited 1 time in total
Back to top
View user's profile Send private message
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Thu Jan 05, 2006 8:54 am    Post subject: Reply with quote

Quote:

You're missing the "from" operand on the MVC. Please correct your post.


Thanks Bill, have done...

Quote:

Your way uses fewer bytes of memory but it's not necessarily the "correct" way.


We will have to agree to disagree about that. I like to keep my literal pools nice and short.
_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Thu Jan 05, 2006 8:56 am    Post subject: Reply with quote

<deleted>
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.


Last edited by Bill Dennis on Thu Jan 05, 2006 10:41 am; edited 1 time in total
Back to top
View user's profile Send private message
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Thu Jan 05, 2006 8:59 am    Post subject: Reply with quote

I've desk checked my work, and I think I'm alright <grin>
_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Thu Jan 05, 2006 9:19 am    Post subject: Reply with quote

Now you need to unit test, system test, get the users to test, and pass the Change Approval Board. Have you got six weeks? Rolling Eyes
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Thu Jan 05, 2006 9:37 am    Post subject: Reply with quote

No, and my best work is not done after a couple of bottles of Fullers ESB! It's 10.00pm down under and 35c today... Hows the weather back home Merv?
_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Thu Jan 05, 2006 10:16 am    Post subject: Reply with quote

Looking like snow, mate. Glad you can still find something proper to drink!

Happy New Year!
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group