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
 

 

TRT saving

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

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Wed Aug 05, 2009 2:03 pm    Post subject: TRT saving
Reply with quote

Hi ,

Is there any way we can avoid declaring a table of 256 byte in TRT when i need to check a byte for Numeric only .

thanks
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Aug 05, 2009 3:49 pm    Post subject: Reply to: TRT saving
Reply with quote

You can check the one-byte (using a CLI) for a value not less than X'F0' (C'0') and not greater than X'F9' (C'9').

I'm assuming you're talking about display-numeric data and not packed-decimal data?

Is this CICS/Assembler?

Bill
Back to top
View user's profile Send private message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Wed Aug 05, 2009 3:55 pm    Post subject:
Reply with quote

Hi Bill ,

I have to go for TRT , sorry my question appeared as if i have one byte only ..I have to check each byte in a string for numeric . i.e I have 20 byte of string and need to check if is pure numeric .

Thanks
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Aug 05, 2009 4:06 pm    Post subject: Reply to: TRT saving
Reply with quote

Define your table as 256X'04', then ORG table+240 with XL10'00'.

If the field contains all numerics, then a CC "BZ" will be raised after the TRT.

Otherwise, R1 will contain the address of the bad-byte and R2 will contain the actual byte-value found.

Optionally, you can clear R1 and R2 to X'00's before the TRT, but it's not necessary.

Some shops have pre-defined tables, which you can bring into the program, via an MVS LOAD Macro (Batch) or CICS LOAD PROGRAM (CICS). It saves base-register addressability and allows a common table for validation, available to all programs.

Bill
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Aug 05, 2009 6:38 pm    Post subject: Reply to: TRT saving
Reply with quote

Optionally, you could use a BCT loop. R14 and R15 are used in this example and should not be a problem. R1 will contain the number of non-numeric bytes found.

Code:

NUMERIC  DS    CL20
*
               SLR   R1,R1
               LA    R14,NUMERIC+L'NUMERIC-1
               LA    R15,L'NUMERIC
NUMLOOP  EQU   *
               CLI   0(R14),C'0'
               BL    NUMFAIL
               CLI   0(R14),C'9'
               BNH   NUMBUMP
NUMFAIL  EQU   *
               LA    R1,1(,R1)
NUMBUMP  EQU   *
               BCTR  R14,0
               BCT   R15,NUMLOOP
               LTR   R1,R1
               BZ    NUMGOOD
* IF THE LTR FAILS (CC IS NOT ZERO), THEN THE NUMERIC FIELD IS NON-NUMERIC
NUMGOOD  EQU   *                               

Bill
Back to top
View user's profile Send private message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Wed Aug 05, 2009 6:50 pm    Post subject:
Reply with quote

Thx Bill , The code is very useful .
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 saving your settings in ISPF. VintageReceiver TSO/ISPF 9 Wed Jul 26, 2017 6:42 pm
No new posts Daylight Saving this Weekend Bill O'Boyle All Other Mainframe Topics 1 Fri Mar 11, 2016 8:40 pm
No new posts soc4 error while saving vsam file in ... inbasekarmani IBM Tools 2 Fri Mar 29, 2013 11:28 am
No new posts CA-ROSCOE saving member name problem . Robert Sample CA Products 6 Wed Mar 02, 2011 3:20 pm
No new posts Trouble saving to the right ISPTLIB d... valyk TSO/ISPF 3 Fri Jan 15, 2010 2:20 am


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