Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
How to write Stem Variable in single Line

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
shr_amar

New User


Joined: 02 May 2005
Posts: 39
Location: DELHI

PostPosted: Wed Feb 06, 2008 6:49 pm    Post subject: How to write Stem Variable in single Line
Reply with quote

Hello -

I have following data in my stem

INput.1 = A
INput.2 = B
INput.3 = C
INput.4 = D
INput.5 = E


I want to write these stem data into a file as one record

0001 ABCDE

Can anyone tell me the process ?

Regards
Back to top
View user's profile Send private message
References
PostPosted: Wed Feb 06, 2008 6:49 pm    Post subject: Re: How to write Stem Variable in single Line Reply with quote

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 2565
Location: italy

PostPosted: Wed Feb 06, 2008 6:55 pm    Post subject: Reply to: How to write Stem Variable in single Line
Reply with quote

Code:
000001 /* REXX */
Trace "O"
svar.0 = 4
svar.1 = "A"
svar.2 = "B"
svar.3 = "C"
svar.4 = "D"
data   = ""
do  i = 1 to svar.0
    data = data || svar.i
end
say "data ==>" || data || "<=="
exit
Back to top
View user's profile Send private message
shr_amar

New User


Joined: 02 May 2005
Posts: 39
Location: DELHI

PostPosted: Wed Feb 06, 2008 7:12 pm    Post subject:
Reply with quote

Thanks for reply

Suppose i want to repeat in a lopp and write in a PS

Eg First execution in loop will return data in stem as

INput.1 = A
INput.2 = B
INput.3 = C
INput.4 = D
INput.5 = E

Second execution will return data as

INput.1 = 1
INput.2 = 2
INput.3 = 3
INput.4 = 4
INput.5 = 5

And the output in PS should be

ABCDE
12345

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

Global Moderator


Joined: 14 Mar 2007
Posts: 2565
Location: italy

PostPosted: Wed Feb 06, 2008 7:57 pm    Post subject: Reply to: How to write Stem Variable in single Line
Reply with quote

here is another sample
the script

Code:
****** ***************************** Top of Data ******************************
000001 /* REXX */
000002 Trace "O"
000003 parse arg coun
000004 Address TSO
000005 do forever
000006     "EXECIO "coun" DISKR SYSUT1 (STEM CARD."
000007     buff.1 = " "
000008     do  i = 1 to card.0
000009         buff.1 = buff.1 || strip(card.i)
000010     end
000011     "EXECIO 1 DISKW SYSUT2 (STEM BUFF."
000012     if  card.0 < coun then ,
000013         leave
000014 end
000015 "EXECIO 0 DISKR SYSUT1 ( FINIS"
000016 "EXECIO 0 DISKW SYSUT2 ( FINIS"
000017 exit
****** **************************** Bottom of Data ****************************


the jcl
Code:

000001 //ENRICO@A JOB (H001),'TSSTEM',NOTIFY=ENRICO,
000002 //             CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1)
000003 //* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
000004 //*            DSN=ENRICO.MF.JCLLIB(TSSTEM)
000005 //* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
000006 // JCLLIB      ORDER=(ENRICO.MF.JCLLIB)
000007 //* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
000008 //*
000009 //TSO     EXEC PGM=IKJEFT01,
000010 //             REGION=0M,
000011 //             DYNAMNBR=20
000012 //SYSPROC   DD DISP=SHR,DSN=ENRICO.ISPF.CLIST
000013 //SYSABEND  DD SYSOUT=*
000014 //SYSPRINT  DD SYSOUT=*
000015 //SYSTSPRT  DD SYSOUT=*
000016 //SYSTSIN   DD *
000017   TSSTEM 4
000018 //SYSUT2    DD SYSOUT=*
000019 //SYSUT1    DD *
000020 A
000021 B
000022 C
000023 D
000024 1
000025 2
000026 3
000027 4
000028 E
000029 F
000030 G
000031 H
000032 5
000033 6
000034 7
000035 8
000036 I
000037 J
000038 K
000039 L
000040 9
000041 0
****** **************************** Bottom of Data ****************************

the result
Code:

........
 ABCD
 1234
 EFGH
 5678
 IJKL
 90
.......
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1