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
 

 

clarification regarding edit mask instruction in assembler

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
pavan k kumar
Currently Banned

New User


Joined: 04 Feb 2007
Posts: 5
Location: andhra

PostPosted: Fri Apr 13, 2007 7:15 am    Post subject: clarification regarding edit mask instruction in assembler
Reply with quote

iam having value '0012345' as an input and want this no to edited and the output sholud like like

'**1234.5'
can anybody help me to do this out
Back to top
View user's profile Send private message

dick scherrer

Site Director


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

PostPosted: Fri Apr 13, 2007 8:29 am    Post subject:
Reply with quote

Hello,

You first need to get your value into a packed-decimal field. Then you need to define your edit mask. Lastly, you need to issue the EDit instruction.

It should go something like (doing this from memory here, so i hope i'm close):

Code:
THEAMT   DC PL4'+0012345'   <--  your amount field
THERSLT  DS CL9             <--  where the edited result goes

               MVC  THERSLT(9),=X'5C202020202020xB20'
               ED   THERSLT,THEAMT

The 5C is the fill character and i believe 5C is an asterisk. The xB is the decimal point (i don't remember if it is 4B or 6B, but am fairly sure it is one of those two). The 20s will be replaced with the fill character until a non-zero is encountered.

Good luck and let us know if this isn't what you want icon_smile.gif
Back to top
View user's profile Send private message
pavan k kumar
Currently Banned

New User


Joined: 04 Feb 2007
Posts: 5
Location: andhra

PostPosted: Sun Apr 15, 2007 7:30 am    Post subject: Re: clarification regarding edit mask instruction in assembl
Reply with quote

hai dick,

thanks for u r reply,
i've done the coding as the following,for the same quesstion above


CODE SNIPPET:

ED MASK,NUM1
MVC OUTREC,MASK
PUT OUTFILE,OUTAREA


NUM1 DS P'0012345'
MASK DS X'5C2020202020204B20'
OUTAREA DS 0CL80
OUTREC DS CL9
SET DS CL71' '


BUT THIS IS GIVING THE O/P AS "***1234.5" BUT I WANTED WAS
"**1234.5" IT IS GIVING ONE * EXTRA.IS THERE ANY PROBLEM IN MY CODING COULD U CHECK THIS OUT
Back to top
View user's profile Send private message
pavan k kumar
Currently Banned

New User


Joined: 04 Feb 2007
Posts: 5
Location: andhra

PostPosted: Sun Apr 15, 2007 7:35 am    Post subject:
Reply with quote

HAI DICK,


SORRY,I HAVE GIVEN

NUM1 DC P'0012345'
MASK DC X'5C2020202020204B20'

EXCEPT THAN THIS ARE THERE ANY ERRORS IN MY CODE
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Sun Apr 15, 2007 7:41 am    Post subject:
Reply with quote

Hi Pavan,

You're welcome icon_smile.gif

I believe your code is working.

Now you need to add another MVC to move the length you want from the result of the EDit to the "final output" area.

One of the "features" of the EDit is that it has to have things "its own way" which means all of the digits need to be accounted for. Once the instruction completes, you have control of the result.

Let me know if that doesn't get the result you want.
Back to top
View user's profile Send private message
pavan k kumar
Currently Banned

New User


Joined: 04 Feb 2007
Posts: 5
Location: andhra

PostPosted: Thu Apr 19, 2007 5:54 am    Post subject: Re: clarification regarding edit mask instruction in assembl
Reply with quote

hai dick

thanks a lot for helpinp me out its working
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Thu Apr 19, 2007 6:19 am    Post subject:
Reply with quote

Hi Pavan,

You're welcome - thanks for letting us know icon_smile.gif
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 755
Location: Germany

PostPosted: Thu Apr 19, 2007 5:30 pm    Post subject:
Reply with quote

Hi Pavan !

Just one additional hint. Your EditMask must have as many signs as as there are numerics in your pack-field, plus each special sign for editing the output.

Example:

Pack-Field DC PL04'4321'

This is hex 00 04 32 1C, which means 7 numeric digits

So mask could be normaly 20202020202020 without any special-sign
And now with Comma and point 20204B2020216B2020
This will result in 43,21 The mask-sign 20 doesn't print a zero but the mask-sign 21 prints it.

So now: pack-field = 7 digits = mask = 7 digits + 4B + 6B = 9 EditSigns

You could a an 5C in front for getting the floating asteriks until a non zero numerig digit. You could also add an hex 60 for getting a negative-sign printed, when the the value is less then zero.

Regards, UmeySan
Back to top
View user's profile Send private message
bengtpelle

New User


Joined: 28 Aug 2006
Posts: 24
Location: St. Petersburg, FL

PostPosted: Sun Apr 22, 2007 12:35 am    Post subject:
Reply with quote

This last posting indicates that a 20 does not print but a 21 prints it.
This is not fully correct.
You only use one 21 in an edit mask. Whereever the 21 occurs, that is the last zero to be replaced by blank if the value is all zeroes.
E.G

ZAP VALUE,=P'0'
ED MASK,VALUE

VALUE DC PL4'0'
MASK DC X'4020202021204B2020'

Would result in ' 0.00'
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 Dump analysis of an assembler module monica1 PL/I & Assembler 4 Tue May 09, 2017 10:05 am
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts how to mask the phone number kumarinfy DB2 4 Mon Apr 03, 2017 5:23 pm
No new posts Mass comment and edit elixir1986 IBM Tools 3 Thu Mar 02, 2017 10:09 pm
No new posts A not very Christmassy PL/I tale, wit... prino PL/I & Assembler 3 Mon Dec 26, 2016 1:01 am


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