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
 

 

Read Decimal Value from JCL into REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
HameedAli

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Tue Oct 05, 2010 9:04 pm    Post subject: Read Decimal Value from JCL into REXX
Reply with quote

I have coded a REXX Program, to read the contents of a file into a stem variable.
I'm trying to add a particular position in the file, say 100,10
I'm aware it is a decimal value, but when I try to add it, The value of the stem is like

Code:
     j @

Code:
     f


How do I convert or read that position from the stem as decimal Value?
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Oct 05, 2010 9:29 pm    Post subject: Reply to: Read Decimal Value from JCL into REXX
Reply with quote

You've been asked before to do this on other topics. Post the content of the data in question as hexadecimal.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Tue Oct 05, 2010 9:30 pm    Post subject:
Reply with quote

I believe that you will use the Rexx built-in C2D function.
Back to top
View user's profile Send private message
HameedAli

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Tue Oct 05, 2010 10:16 pm    Post subject:
Reply with quote

here is the data, 15,8 is the position.
Code:
0----+----1----+----2----+----3---
            <                     
                    Ñèð           
                    Ñèæ           
            <       â&           
            <       â&           
                                 
            <        -           
            <      Ëj @           
                    `Îæ           
                    Ìn           
                    ê            
            %       á             
            %        ø           
            <       ã°           
            <       ã°           
            <       ã°           
            <       ã°           
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Oct 05, 2010 10:22 pm    Post subject: Reply to: Read Decimal Value from JCL into REXX
Reply with quote

You might get better help if You would post the hex representation of the <things>
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: Tue Oct 05, 2010 10:45 pm    Post subject:
Reply with quote

Hello,

Quote:
Post the content of the data in question as hexadecimal
And yet you post the unneeded "display" content.

Use HEX ON and show the hex. . .
Back to top
View user's profile Send private message
HameedAli

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Tue Oct 05, 2010 10:54 pm    Post subject:
Reply with quote

Excuse me for the drag. Please help me out in getting 115,8 as decimal value in REXX

Code:
0----+----1----+----2----+----3----+----4----+----
                    Ñèð                           
44444444444010000000658000000000000000044444444444
000000000005C0C0000594C0000000C0000000C00000000000
-------------------------------------------------
                    Ñèæ                           
44444444444010000000659000000000000000044444444444
000000000005C0C0000594C0000000C0000000C00000000000
-------------------------------------------------
            <       â&                           
44444444444040000000450000000000000000044444444444
000000000005C0C0000020C0000000C0000000C00000000000
-------------------------------------------------
            <       â&                           
44444444444040000000450000000000000000044444444444
000000000005C0C0000020C0000000C0000000C00000000000
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Oct 05, 2010 11:02 pm    Post subject:
Reply with quote

Hameed Ali,

Akatsukami has already suggested something that may work.

for the future:
do you even bother to debug this stuff that you write,
or do you just blindly execute and when it does not work, ask for a solution?

you should have run this using TRACE, which would have provided you with something to work with.

This is a very easy and elemental problem to debug. you need to increase your skill level,
as well as,
provide people answers to their questions.
This silliness has been going on for 2 hours and you are nowhere near
solving your problem.

and another thing. obviously your are a beginner at REXX
and
have not bother to learn or understand the language.
everything in REXX is char (x-type).
there are many functions which will convert data from one datatype to another.

you need to read.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Tue Oct 05, 2010 11:05 pm    Post subject:
Reply with quote

Actually, Hameed, none of the records that you have chosen to display contain the value 115.8, so you will never see that as your output from this sample.

Nonetheless, try this:
  1. Substring the packed decimal number to work variable #1
  2. Use work variable #1 as the argument to the C2D function giving work variable #2
  3. Insert a decimal separation into work variable #2 at the appropriate place (note that there is no inherent means of representing scale in packed decimal numbers; you have to know where it is)
  4. Use as desired.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Oct 05, 2010 11:18 pm    Post subject: Reply to: Read Decimal Value from JCL into REXX
Reply with quote

If you find at some point that you want to convert packed-decimal to decimal, you can try the P2D function shown in this previous topic.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Oct 05, 2010 11:36 pm    Post subject: Reply to: Read Decimal Value from JCL into REXX
Reply with quote

searching forums for my posts with "REXX PACK UNPACK"
will certainly point You to ...

http://ibmmainframes.com/viewtopic.php?t=41407&highlight=rexx+pack+unpack

which in turn will suggest

http://ibmmainframes.com/viewtopic.php?t=31547&postdays=0&postorder=asc&start=15

http://ibmmainframes.com/viewtopic.php?t=27921&highlight=rexx+pack+unpack
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Wed Oct 06, 2010 1:44 am    Post subject: Reply to: Read Decimal Value from JCL into REXX
Reply with quote

It is not clear what this has to do with "Read Decimal Value from JCL into REXX".
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed Oct 06, 2010 2:04 am    Post subject:
Reply with quote

Probably because the OP's request actually has nothing to do with "read decimal value from JCL into Rexx".
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: Wed Oct 06, 2010 2:37 am    Post subject:
Reply with quote

Hello,

Not sure if this applies to this topic, but unfortunately, we have many participants who believe that inline/instream data, code, or control statements are JCL . . .
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


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