HP3000-L Archives

August 2000, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Michael Berkowitz <[log in to unmask]>
Reply To:
Michael Berkowitz <[log in to unmask]>
Date:
Tue, 8 Aug 2000 08:56:38 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (50 lines)
Raghavendra Rao writes:

-----Original Message-----
From: [log in to unmask] [mailto:[log in to unmask]]
Sent: Tuesday, August 08, 2000 8:40 AM
To: [log in to unmask]
Subject: Leading Zeroes populator ?


Hi all,

I am reading a unique record (from database) which has a field NUMBER which
is defined as I2.. I would like to extract this value somehow using a SETVAR
<filename> or something like that.. !! Following is the requirements..

The NUMBER could be a 1digit, 2 digit, 3digit or 4 digit or 5 digit numeric
number. I would like to extract this number into a 5 digit numeric number
prefixed with leading ZEROES upto the 5th digit irrespective of whatever
value is there in that field.. For ex : if the value in field NUMERIC is 375
then I would want my extract to be 00375.

My final goal is to have the following :
SETVAR FILENAME "PF" + "5 digit numeric number with leading ZEROES coming
from NUMBER" ..
With the above example I would like to have the FILENAME having value
"PF00375"..

Is there any ASCII definitions or leading ZERO populator ? If so how do I do
it ?

Thanks in advance for all your flooding replies.. !!
Regards
Raghu..
----------------------------------------------
Well since you're reading this data via a program, since MPE CI can't read
from a database, why not do this at least in COBOL.

CALL "DBGET" USING yada yada yada  buffer area (PIC S9(9) COMP)
MOVE I2-FIELD TO Z-FIELD PIC 9(5) DISPLAY.
STRING "SETVAR FILENAME " QUOTE "PF" Z-FIELD QUOTE
    DELIMITED BY SIZE INTO COMMAND.
CALL INTRINSIC "COMMAND"
    USING COMMAND PARM1 PARM2.

Don't forget to add a carriage control (%15) to your command before calling
"COMMAND".

Mike Berkowitz
Guess? Inc.

ATOM RSS1 RSS2