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

How to write Stem Variable in single Line


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

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Wed Feb 06, 2008 6:49 pm
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
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Feb 06, 2008 6:55 pm
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
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Wed Feb 06, 2008 7:12 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Feb 06, 2008 7:57 pm
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
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 Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top