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

Transferring Multiple files to OMVS using SFTP


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Tue Dec 22, 2009 3:45 pm
Reply with quote

Dear Experts,

Below is my code,
I'm using to transfer multiple (2 files in this case) to OMVS using SFTP.
The job is executing successfully with MAXCC = 0
But When I login on OMVS, I'm able to see only first file not the second file.

ALLOCATE DDNAME(KPAYR) -
PATH('/u/users/USERID/USER.FILE1.txt') -
PATHDISP(KEEP,DELETE) PATHMODE(SIRWXU) -
PATHOPTS(OCREAT,OWRONLY)
OCOPY INDD(INDSN1) OUTDD(KPAYR) TEXT CONVERT((BPXFX311)) FROM1047
ALLOCATE DDNAME(KPAYR) -
PATH('/u/users/USERID/USER.FILE2.txt') -
PATHDISP(KEEP,DELETE) PATHMODE(SIRWXU) -
PATHOPTS(OCREAT,OWRONLY)
OCOPY INDD(INDSN2) OUTDD(KPAYR) TEXT CONVERT((BPXFX311)) FROM1047

Please help me with the correct code.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Dec 22, 2009 4:45 pm
Reply with quote

I haven't tested anything, but unless there's stuff you haven't shown us you are not freeing KPAYR between the OCOPY statements. Without freeing the DDname, I don't think it'll be allocated to the second file so you should only be seeing the one file copied into the directory.
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Tue Dec 22, 2009 5:22 pm
Reply with quote

Robert,

What additional commands are requiered between the two ALLOCATE commands to free the KPAYR ???
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Dec 22, 2009 5:49 pm
Reply with quote

We're not using SFTP so I'm not sure of the command syntax. Why not change the second allocate to use DDNAME KPAYS and the OCOPY to go to KPAYS instead of KPAYR? Different DDNAME, end of problem.
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Tue Dec 22, 2009 6:15 pm
Reply with quote

Hi robert,
You are rocking.

I chaged the DDName and it's worked.
Myth: I felt DDName - KPAYR is pre-defined.

No, My job become easy.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Dec 22, 2009 7:18 pm
Reply with quote

Glad to hear it worked. And I doubt something like KPAYR would be standardized -- INPUT, OUTPUT, SYSIN, SYSPRINT all make sense, but definitely not KPAYR!
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top