Question on using SFTP to send file to Mainframe



Post anything related to mainframes (IBM & UNISYS) if not fit in any of the above categories

Question on using SFTP to send file to Mainframe

Postby vespa » Sat Sep 19, 2009 3:46 am

I'm having problem with uploading a file from the Unix host machine to an MVS file.
The mainframe file is already exist and it's empty, and the SFTP job completed o.k., however, upon the job completion,
I checked the mainframe file TEST.SFTP.FILE1, and it's empty, did I leave something out in the GET syntax?

[code][/code]
//INPUT EXEC PGM=IEBGENER
//SYSPRINT DD DUMMY
//SYSIN DD DUMMY
//SYSUT2 DD PATH=('/tmp/&SYSUID..sftp.input'),FILEDATA=TEXT,
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU
//*
//SYSUT1 DD *
ascii
ls
cd inputfile_tmp
ls -l
get file1_test.txt "//'TEST.SFTP.FILE1'"
quit
/*
//*
//SFTP EXEC PGM=BPXBATCH,
// PARM='SH sftp -v -b/tmp/&SYSUID..sftp.input
// mfftp@test.server.name'
//STDOUT DD PATH='/tmp/&SYSUID..STDOUT',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU
//*
vespa
 
Posts: 19
Joined: Thu Jul 23, 2009 5:30 am
Has thanked: 0 time
Been thanked: 0 time

Re: Question on using SFTP to send file to Mainframe

 

Re: Question on using SFTP to send file to Mainframe

Postby dick scherrer » Mon Sep 21, 2009 2:26 am

Hello,

Please post the messages from the ftp run.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Question on using SFTP to send file to Mainframe

Postby vespa » Wed Sep 23, 2009 2:42 am

Hello Dick,

This issue has been resolved :-). After the GET process completed, the MVS file has data, however, it's still in USS enviroment. For SFTP, I need to add a step to run the PGM=IKJEFT01 to send the file from USS to MVS enviroment and it's working now.

New quesion, is there a way to "force" the step to have RC> 0 when it didn't work?

In the 1st step (IEBGENER), when there was an invalid unix command in SYSUT1 DD *, the step issued return code = 0.

In the 2nd step (BPXBATCH), when there was a connection problem to the server, the step issued return code = 0.
As we need to release subsequent job upon a successul run of these steps, we need the step to issue RC > 0 when
there is a problem.

Thanks.

These steps:

//INPUT EXEC PGM=IEBGENER
//SYSPRINT DD DUMMY
//SYSIN DD DUMMY
//SYSUT2 DD PATH=('/tmp/&SYSUID..sftp.input'),FILEDATA=TEXT,
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU
//*
//SYSUT1 DD *
ascii
ls
cd inputfile_tmp
ls -l
get file1_test.txt "//'TEST.SFTP.FILE1'"
quit
/*
//*
//SFTP EXEC PGM=BPXBATCH,
// PARM='SH sftp -v -b/tmp/&SYSUID..sftp.input
// mfftp@test.server.name'
//STDOUT DD PATH='/tmp/&SYSUID..STDOUT',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU
//*
vespa
 
Posts: 19
Joined: Thu Jul 23, 2009 5:30 am
Has thanked: 0 time
Been thanked: 0 time

Re: Question on using SFTP to send file to Mainframe

Postby dick scherrer » Wed Sep 23, 2009 3:16 am

Hello,

is there a way to "force" the step to have RC> 0 when it didn't work
Well, the step "worked" as far as the system is concerned. The step issued a request (rather than actually doing a task) and the request was issued successfully.

For the iebgener process, once the script is debugged, this should no longer be an issue.

For the bxpbatch step, you might consider writing the informational messages to a file and then processing that file to determine if there was a problem.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Question on using SFTP to send file to Mainframe

Postby vespa » Thu Sep 24, 2009 8:34 am

Thanks for the suggestion, looks like that's the only option to determine if there was a problem with the step.
I'm having problem sending the message to an MVS file, did I leave out some option in the JCL (2nd run and 3rd run)?

1st run, this JCL worked, the informational message is available in the hold queue and I can view it;

//STDOUT EXEC PGM=IEBGENER                                                                 
//SYSPRINT DD  DUMMY                                                                       
//SYSIN    DD  DUMMY                                                                         
//SYSUT1   DD  PATH='/tmp/&SYSUID..STDOUT',                                               
//             FILEDATA=TEXT,PATHOPTS=ORDONLY,PATHDISP=DELETE,                           
//             RECFM=VB,LRECL=255,BLKSIZE=27998                                           
//SYSUT2  DD SYSOUT=*


2nd run, I allocated an MVS file FILE1.TEST.LOG, update the JCL to have SYSUT2 DD points to this file and I'm running into some problem of invalid PATH

//SYSUT2   DD  DSN=FILE1.TEST.LOG,DISP=OLD


3rd run, I updated the JCL with the PATH option and getting the same error message "invalid PATH"
//SYSUT2   DD  PATH='/FILE1.TEST.LOG',             
//             FILEDATA=TEXT,                 
//             PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU                           
vespa
 
Posts: 19
Joined: Thu Jul 23, 2009 5:30 am
Has thanked: 0 time
Been thanked: 0 time

Re: Question on using SFTP to send file to Mainframe

Postby dick scherrer » Fri Sep 25, 2009 3:14 am

Hello,

Please submit the 2nd run again (with the pre-allocated file) and post the complete jcl, control statements, and the informational output generated.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Question on using SFTP to send file to Mainframe

Postby vespa » Sat Sep 26, 2009 2:22 am

2nd run - with the pre-allocated file - FILE1.TEST.LOG.SYSUT2 (FB,RECL=200)

JCL

//#TSJOB0Z JOB (00763200000000TS,TST),'  TEST job      ',     
//         CLASS=A,MSGCLASS=X,REGION=7168K
//*                                                           
//INPUT EXEC PGM=IEBGENER
//SYSPRINT DD DUMMY
//SYSIN DD DUMMY
//SYSUT2 DD PATH=('/tmp/&SYSUID..sftp.input'),FILEDATA=TEXT,
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU
//*
//SYSUT1 DD *
ascii
ls
cd inputfile_tmp
ls -l
get file1_test.txt "//'TEST.SFTP.FILE1'"
quit
/*
//*
//SFTP EXEC PGM=BPXBATCH,
// PARM='SH sftp -v -b/tmp/&SYSUID..sftp.input
// mfftp@test.server.name'
//STDOUT DD PATH='/tmp/&SYSUID..STDOUT',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU
//*
//STDOUT EXEC PGM=IEBGENER                                     
//SYSPRINT DD  DUMMY                                           
//SYSIN    DD  DUMMY                                           
//SYSUT1   DD  PATH='/tmp/&SYSUID..STDOUT',                   
//             FILEDATA=TEXT,PATHOPTS=ORDONLY,PATHDISP=DELETE,
//             RECFM=VB,LRECL=255,BLKSIZE=27998               
//SYSUT2   DD DSN=FILE1.TEST.LOG.SYSUT2,DISP=OLD       


The job failed in the IEBGENER step with an error FGN3042I
FASTGENR NOGO, CODE = 20 - ERROR IN FASTGENR COPY STEP

IEF236I ALLOC. FOR #TSJOB0Z INPUT                                                                                         
 IEF237I DMY  ALLOCATED TO SYSPRINT                                                                                       
 IEF237I DMY  ALLOCATED TO SYSIN                                                                                           
 IGD103I SMS ALLOCATED TO DDNAME SYSUT2                                                                                   
 IEF237I JES2 ALLOCATED TO SYSUT1                                                                                         
 IEF142I #TSJOB0Z INPUT - STEP WAS EXECUTED - COND CODE 0000                                                               
 IGD104I HFS FILE WAS RETAINED, DDNAME IS (SYSUT2  )                                                                       
 FILENAME IS (/tmp/#TSJOB0.sftp.input)                                                                                     
 IEF285I   #TSJOB0.#TSJOB0Z.JOB07632.D0000101.?         SYSIN                                                             
 IEF373I STEP/INPUT   /START 2009268.1036                                                                                 
 IEF374I STEP/INPUT   /STOP  2009268.1036 CPU    0MIN 00.01SEC SRB    0MIN 00.00SEC VIRT  3192K SYS   260K EXT     512K SYS
 IEF236I ALLOC. FOR #TSJOB0Z SFTP                                                                                         
 IGD103I SMS ALLOCATED TO DDNAME STDOUT                                                                                   
 IEF142I #TSJOB0Z SFTP - STEP WAS EXECUTED - COND CODE 0000                                                               
 IGD104I HFS FILE WAS RETAINED, DDNAME IS (STDOUT  )                                                                       
 FILENAME IS (/tmp/#TSJOB0.STDOUT)                                                                                         
 IEF373I STEP/SFTP    /START 2009268.1036                                                                                 
 IEF374I STEP/SFTP    /STOP  2009268.1036 CPU    0MIN 00.01SEC SRB    0MIN 00.00SEC VIRT    52K SYS   252K EXT      16K SYS
IEF142I #TSJOB0Z *OMVSEX - STEP WAS EXECUTED - COND CODE 0000                                                             
IEF373I STEP/*OMVSEX /START 2009268.1036                                                                                   
IEF374I STEP/*OMVSEX /STOP  2009268.1036 CPU    0MIN 00.02SEC SRB    0MIN 00.00SEC VIRT    64K SYS   252K EXT     528K SYS
IEF142I #TSJOB0Z *OMVSEX - STEP WAS EXECUTED - COND CODE 0000                                                             
IEF373I STEP/*OMVSEX /START 2009268.1036                                                                                   
IEF374I STEP/*OMVSEX /STOP  2009268.1036 CPU    0MIN 00.02SEC SRB    0MIN 00.00SEC VIRT    64K SYS   248K EXT     504K SYS
IEF236I ALLOC. FOR #TSJOB0Z STDOUT                                                                                         
IEF237I DMY  ALLOCATED TO SYSPRINT                                                                                         
IEF237I DMY  ALLOCATED TO SYSIN                                                                                           
IGD103I SMS ALLOCATED TO DDNAME SYSUT1                                                                                     
IGD103I SMS ALLOCATED TO DDNAME SYSUT2                                                                                     
FGN3042I  FASTGENR NOGO, CODE = 20 - ERROR IN FASTGENR COPY STEP                                                           
FGN0199I  END OF FASTGENR EXECUTION - RC(12)                                                                               
IEF142I #TSJOB0Z STDOUT - STEP WAS EXECUTED - COND CODE 0012                                                               
IGD105I HFS FILE WAS DELETED, DDNAME IS (SYSUT1  )                                                                         
FILENAME IS (/tmp/#TSJOB0.STDOUT)                                                                                         
IGD104I FILE1.TEST.LOG.SYSUT2                       RETAINED,  DDNAME=SYSUT2                                             
IEF373I STEP/STDOUT  /START 2009268.1036                                                                                   
IEF374I STEP/STDOUT  /STOP  2009268.1036 CPU    0MIN 00.04SEC SRB    0MIN 00.00SEC VIRT  3192K SYS   276K EXT     560K SYS
IEF375I  JOB/#TSJOB0Z/START 2009268.1036         
IEF376I  JOB/#TSJOB0Z/STOP  2009268.1036 CPU    0MIN 00.10SEC SRB    0MIN 00.00SEC   
vespa
 
Posts: 19
Joined: Thu Jul 23, 2009 5:30 am
Has thanked: 0 time
Been thanked: 0 time

Re: Question on using SFTP to send file to Mainframe

Postby dick scherrer » Sat Sep 26, 2009 2:53 am

Hello,

Please note that your input (sysut1) and your output (sysut2) in the iebgener have different lrecls. I suspect this is a problem.

Suggest you look in the documentation for the specifics of the FGN3042I message. As this is not a standard IBM message, it is not in the IBM documentation.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Question on using SFTP to send file to Mainframe

Postby vespa » Sat Sep 26, 2009 3:35 am

I can't believe I missed the recl between SYSUT1 and SYSUT2 was different ! :o I corrected the recl and now able to capture the informational message in the MVS file. Thanks so much for your helps Dick. :)
vespa
 
Posts: 19
Joined: Thu Jul 23, 2009 5:30 am
Has thanked: 0 time
Been thanked: 0 time

Re: Question on using SFTP to send file to Mainframe

Postby dick scherrer » Sun Sep 27, 2009 3:30 am

You're welcome :)

Good to hear it is working - thanks for letting us know :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to All other Mainframe Topics

 


  • Related topics
    Replies
    Views
    Last post