×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# REXX Get last two digits of the year

 Forum Search FAQs Links MVPs

## REXX Get last two digits of the year

(OP)
Hi,
I would like to display the last two digits of the year from the code below, please amend, thx

#### CODE -->

ystrday = date('s',(date('b')-1,'b')
CALL ZocSend "RE"||ystrday"||" ^M" 

RE20240208
Am expecting a result of RE240208

### RE: REXX Get last two digits of the year

use

#### CODE

substr(ystrday,3)

### RE: REXX Get last two digits of the year

(OP)

#### Quote:

mikrom (Programmer)
use

#### CODE -->

CODE
substr(ystrday,3) 

Hi mikrom, thank you so much.

### RE: REXX Get last two digits of the year

(OP)
mikrom (Programmer)
use

#### CODE -->

substr(ystrday,3)

### RE: REXX Get last two digits of the year

you can use the substr() function

#### CODE

yyyymmdd = date('s')
say(yyyymmdd)

ddmmyyyy = substr(yyyymmdd,7,2)||substr(yyyymmdd,5,2)||substr(yyyymmdd,1,4)
say(ddmmyyyy) 

Output

#### CODE

20240209
09022024 

Here is a good tutorial for learning basics of REXX. There have online interpreter, where you can try out your code snippets
https://www.tutorialspoint.com/rexx/rexx_substr.ht...

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

#### Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!