/* Sample for a FTP transfer of data to the ftp.ecurep.ibm.com */
/* Server, userid and password are from file NETRC DATA A */
/* which should like this without comments */
/* machine oddjob login anonymou password anonymou */
/* machine ftp.ecurep.ibm.com login anonymous password xxx§zzzzz */
/* */
/* */
/* You can call these exec with parameter */
/* DOWN fn ft fm pmr branch country */
/* fn = filename */
/* ft = filetype */
/* fm = filemode */
/* pmr = IBM PMR ID (Problem mangement record ID) */
/* branch = IBM Branch office ID */
/* country = IBM Country number */
/* */
/* or correct the following lines and remove the comment */
/* fn = DUMP */
/* ft = CPACK */
/* fm = A */
/* pmr = 99999 */
/* branch = 111 */
/* country = 724 */
/* */
/* */
Address CMS
/* correct the linkname for TCPIP if necessary */
'VMLINK TCPIP '
fn = QT
ft = REXTRACE
fm = A
pmr = 99999
branch = 111
country = 724
cmstype = Cmsflag('CMSTYPE')
s = Translate(Diag(8,'Q SET'),' ',','!!'15'x)/* comma and tab: blanks*/
Parse Var s 'MSG' msg . 'EMSG' emsg . 'IMSG' imsg . 'SMSG' smsg .
Call DIAG 8,'SET MSG OFF' !! '15'x , /* Set messages off as needed*/
'SET EMSG OFF' !! '15'x , /* Separate with the newline */
'SET IMSG OFF' !! '15'x , /* character */
'SET SMSG OFF'
Address COMMAND 'GLOBALV SELECT CPCMS', /* Store settings in GLOBALV */
'SETL VARS' cmstype msg emsg imsg smsg
if arg()/=0 then
Parse Arg fn ft fm pmr branch country
Do Until Var='ASKFILE'
'STATE' fn ft fm
If rc=0 Then
Do
fn = Strip(fn)
ft = Strip(ft)
fm = Strip(fm)
Var='ASKFILE'
End
Else
Do
Say 'Please type filename filetype and filetype or type EXIT'
Pull fn ft fm
If fn='EXIT' Then
Exit
End
End
Do Until Var='ASKPMR'
If Datatype(pmr)='NUM' & Length(pmr)=5 Then
Var ='ASKPMR'
Else
Do
Say 'Please type PMR ID or EXIT'
Pull pmr
If pmr='EXIT' Then
Exit
Iterate
End
End
Do Until Var='ASKBRA'
If Datatype(branch)='NUM' & Length(branch)=3 Then
Var ='ASKBRA'
Else
Do
Say 'Please type your IBM Branch office ID or EXIT'
Pull branch
If branch='EXIT' Then
Exit
Iterate
End
End
Do Until Var='ASKCOU'
If Datatype(country)='NUM' & Length(country)=3 Then
Var='ASKCOU'
Else
Do
Say 'Please type your IBM country ID or EXIT'
Pull country
If branch='EXIT' Then
Exit
Iterate
End
End
/* create the pack file */
'COPYFILE 'fn ft fm '= = = (replace pack'
foreign=Space(pmr!!'.'!! branch !!'.'!!country!!'.'!!fn!!'.'!!ft,0)
local =Space(fn!!'.'!!ft!!'.'!!fm,0)
Queue 'cd /toibm/s390/'
Queue 'bin'
Queue 'put ' local foreign
Queue 'quit'
'FTP ftp.ecurep.ibm.com (EXIT'
rca=rc
Address COMMAND 'GLOBALV SELECT CPCMS', /* GET SETTINGS FROM GLOBALV */
'GET VARS'
Parse Var vars cmstype msg emsg imsg smsg
Call DIAG 8,'SET MSG ' msg !! '15'x , /* ALL RESETS IN SAME CALL */
'SET EMSG' emsg !! '15'x ,
'SET IMSG' imsg !! '15'x ,
'SET SMSG' smsg
If cmstype Then
'SET CMSTYPE RT' /* CMSTYPE IS DIFFERENT */
Else
'SET CMSTYPE HT'
Exit rca