banner



How To Change Character In Packed Field Assembler

View previous topic :: View next topic Author Bulletin kalpana

New User

Joined: 19 Nov 2004
Posts: 24
Location: Banglore


Post Posted: Thu Jul 03, 2008 1:55 pm
Reply with quote

COuld whatever please propose me code for converting graphic symbol field to packed field

tin i utilize PACK control

Back to tiptop Garry Carroll

Senior Member

Joined: 08 May 2006
Posts: 1141
Location: Dublin, Ireland


Post Posted: Thu Jul 03, 2008 5:03 pm
Reply with quote

Depends on which language you're using.

For Assembler, use the PACK didactics. For PL/one have a PIC declare of your CHAR field and assign the Moving picture to the DECIMAL Fixed field.

due east.g.

Code:

DCL        CHAR_FIELD           CHAR(5);
DCL        PIC_FIELD            PIC'(5)9' BASED(ADDR(CHAR_FIELD));
DCL        DEC_FIELD            DEC FIXED(five);

   CHAR_FIELD = '12345';
DEC_FIELD   = PIC_FIELD;


Regards,
Garry
Back to summit kalpana

New User

Joined: nineteen Nov 2004
Posts: 24
Location: Banglore


Post Posted: Thu Jul 03, 2008 5:56 pm
Reply with quote

Iam using Assembler..

I want code for the conversion

Back to top Garry Carroll

Senior Fellow member

Joined: 08 May 2006
Posts: 1141
Location: Dublin, Ireland


Post Posted: Thu Jul 03, 2008 half-dozen:02 pm
Reply with quote

Both operands accept length fields
Code:

   PACK  DOUBLE,0(4,R8)
.
.
.
.
.
DOUBLE   DS   D

volition pack a 4-grapheme field at R8 into the doubelword field named DOUBLE.

This could also be coded as

Lawmaking:

PACK  0(8,DOUBLE),0(four,R8)

Regards,
Garry.

Back to meridian kalpana

New User

Joined: 19 Nov 2004
Posts: 24
Location: Banglore


Post Posted: Friday Jul 04, 2008 12:14 pm
Reply with quote

Really my requirement F_nomval is a graphic symbol filed of 16 bytes

i have stored value four.000000 thru screen

i declard F_nv_pack equally double give-and-take

PACK F_nv_pack,f_nomval

i checked the value of f_nv_pack by putting delibrate dump

but iam getting value 0 in the F_nv_pack field

could any 1 help me with query???

Many thank you in accelerate

Kalpana

Back to meridian enrico-sorichetti

Superior Fellow member

Joined: 14 Mar 2007
Posts: 10823
Location: italy


Post Posted: Friday Jul 04, 2008 1:09 pm
Reply with quote

in that location is very niggling that we can exercise from here

PACK/unpack are 2 of the most elementary and most dumb instructions ...
review its clarification in the manual

- they volition take anything as input an build the output according to the specifications
- they will never plan cheque for information exception
- they are GIGO ( garbage in garbage out ) instruction

Back to top murugan_mf

Active User

Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India


Post Posted: Thu Jul 10, 2008 4:59 pm
Reply with quote

Code:
DCL        CHAR_FIELD           CHAR(5);
DCL        PIC_FIELD            PIC'(five)9' BASED(ADDR(CHAR_FIELD));
DCL        DEC_FIELD            DEC FIXED(5);

   CHAR_FIELD = '12345';
DEC_FIELD   = PIC_FIELD;

What is the need of using based?
can't we direct assign

Back to top Craq Giegerich

Senior Member

Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA


Post Posted: Thu Jul ten, 2008 5:24 pm
Reply with quote

kalpana wrote:
Actually my requirement F_nomval is a character filed of 16 bytes

i have stored value four.000000 thru screen

i declard F_nv_pack every bit double discussion

PACK F_nv_pack,f_nomval

i checked the value of f_nv_pack by putting delibrate dump

merely iam getting value 0 in the F_nv_pack field

could whatsoever ane assist me with query???

Many thanks in advance

Kalpana

4.000000 is not 16 bytes and it can not be packed since information technology is non numeric. In assembler the developer has to continue rail of where the decimal point is suppose to exist.

Back to acme Garry Carroll

Senior Member

Joined: 08 May 2006
Posts: 1141
Location: Dublin, Ireland


Post Posted: Thu Jul x, 2008 5:31 pm
Reply with quote

Hi Murugan,
Quote:
What is the demand of using based?

This is for PL/1 only. "BASED" is used to overlay the CHAR field with a Motion-picture show field. Yous could also use Defined to accomplish the same result, but Define is, IMHO, less flexible.
Quote:
can't we directly assign

No, You tin't assign a CHAR field direct into a DECIMAL FIXED field.

Regards,
Garry.

Dorsum to top

Source: https://ibmmainframes.com/about32184.html

Posted by: benoitcabol2001.blogspot.com

0 Response to "How To Change Character In Packed Field Assembler"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel