IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Which rexx command will append characters to the string?


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Thu May 29, 2008 11:40 am
Reply with quote

HI,

My variable DDNAME has value
DDNAME=DEV2.TEST.SAMPLE

I want to store "DEV2.TEST.SAMPLE" to DSN variable like this

DSN="DEV2.TEST.SAMPLE"

Which rexx command will append characters to the string?

Regards
R KARTHIK
Back to top
View user's profile Send private message
satheeshkamal

New User


Joined: 09 Jan 2007
Posts: 28
Location: Chennai

PostPosted: Thu May 29, 2008 11:44 am
Reply with quote

Just use

[/code]
DSN = DSNAME
Code:
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu May 29, 2008 11:45 am
Reply with quote

Your request is not clear at all...

Quote:
I want to store "DEV2.TEST.SAMPLE" to DSN variable like this
DSN="DEV2.TEST.SAMPLE"

You already achieved what You asked for

but what You are showing is a simple assignment
DSN = DDNAME

why not search the REXX manuals for the "concatenate" operator

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/IKJOSE20
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu May 29, 2008 11:47 am
Reply with quote

Hi,
I'm assuming you want the concatenation operand (two single OR bars, ||)

Gerry
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Thu May 29, 2008 12:06 pm
Reply with quote

HI,

Actually following piece of code works for both open a member in a PDS
and PS file by placing cursor in that line.

CODE I
Code:

/* REXX */                           
ADDRESS ISREDIT MACRO                 
"ISREDIT (LIN,COL) = CURSOR"         
"ISREDIT (DATA) = LINE .ZCSR"         
IF SUBSTR(DATA,1,2) = "//" THEN       
DO                                   
A=POS("=",DATA)+1                     
B=POS(",",DATA)                       
C=B-A                                 
DSN=SUBSTR(DATA,A,C)                 
"ISPEXEC EDIT DATASET('"DSN"')"       
END                                   


But when I try below the code
CODE II
Code:

/* REXX */                         
DSN=DEV2.RK.JCL(ALLDUPS)
"ISPEXEC EDIT DATASET('"DSN"')"   


It is throwing
2 +++ DSN=DEV2.RK.JCL(ALLDUPS)
IRX0043I Error running SAMPLE, line 2: Routine not found
***
And when i try
Code:

/* REXX */                         
DSN="DEV2.RK.JCL(ALLDUPS)"
"ISPEXEC EDIT DATASET('"DSN"')"   


It is working.....

I did not place extra " in CODE I. But there working...Why?


Regards
R KARTHIK
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu May 29, 2008 12:17 pm
Reply with quote

in REXX things are self defining icon_biggrin.gif

if You use a variable not initialized the variable name will be the value assigned

Code:
var = donaldduck

var will contain the string "donaldduck

Code:
donaldduck = 1
var = donaldduck

var will contain the value 1

dsn=qual1.qual2.qual3

the right side expression is considered a stemmmed variable
composed by the three variables qual1 qual2 qual3

and since qual1 qual2 qual3 are not initialized
the result will be a good dataet name

but that's a coding error

if You repeat the error with a member name added
the right hand side will be considered as a function call
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Thu May 29, 2008 12:47 pm
Reply with quote

HI enrico-sorichetti,

Now i understand. Thanks for ur detailed reply and helping freshers like me....

Cheers
R KARTHIK
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Running REXX through JOB CLIST & REXX 13
Search our Forums:

Back to Top