Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Copying a file from Unix to Mainframe using Connect : Direct

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
raju.mopidevi

New User


Joined: 18 Sep 2011
Posts: 12
Location: India

PostPosted: Thu Jun 28, 2012 4:49 pm    Post subject: Copying a file from Unix to Mainframe using Connect : Direct
Reply with quote

I am submitting like this

Code:

  SIGNON CASE=YESS USERID=<myID,pwd>
  SUBMIT PROC=GETTXTFL    -
     SNODE=unixservername -
     &PDSN=mainframe file -
     &SDSN='/storage/report.txt' -
  SIGNOFF


GETTXTFL PROC code is as follows
Code:

GETTXTFL PROCESS  -
STEP01 COPY  -
FROM(SNODE  -
  DSN=&SDSN -
  DISP=SHR -
 )COMPRESS EXT -
TO(PNODE -
  DSN=&PDSN -
  SYSOPTS=":DATATYPE=TEXT:XLATE=NO:STRIP.BLANKS=NO" -
  DCBINOF='DCB=(DSORG=PS, RECFM=U)' -
  DISP=RPL,CATLG,DELETE)
EXIT


I am getting this error,
Code:

 LONG TEXT =>  When using the SUBmit command OUTSIDE the process the keyword 'PROC'     
                 or 'DSN' must be specified. Other valid optional command       
                 keywords:'HOLD', 'NEWNAME', 'PNODE', 'PRTY', 'RETAIN',         
                 'SNODE', 'CLASS', 'STARTT', and symbolic parameter values     
                 (designated by '&' as a prefix) are valid.
               
SYSTEM ACTION: Return to invoker with RC=8

RESPONSE: Reenter your SUBmit command using only the keywords listed above. check PROCess statement keyword.


Can you tell where I am using wrong keywords ?

Thanks,
Raju
Back to top
View user's profile Send private message

Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Thu Jun 28, 2012 5:00 pm    Post subject: Re: Copying a file from Unix to Mainframe using Connect : Di
Reply with quote

raju.mopidevi wrote:
Code:

  SIGNON CASE=YESS USERID=<myID,pwd>
  SUBMIT PROC=GETTXTFL    -
     SNODE=unixservername -
     &PDSN=mainframe file -
     &SDSN='/storage/report.txt' -
  SIGNOFF
Can you tell where I am using wrong keywords ?


Did you cut-and-paste that text ?

There are 2 errors:
1. YESS should be YES
2. the line with "&SDSN" should not have a continuation character (the minus at the end).
Back to top
View user's profile Send private message
raju.mopidevi

New User


Joined: 18 Sep 2011
Posts: 12
Location: India

PostPosted: Thu Jun 28, 2012 5:03 pm    Post subject:
Reply with quote

Thanks for the immediate reply,

Actually those two are typo. I didn't cut pasted.

1. CASE=YES
2. I didn't put continuation character after &SDSN in my original file

---
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Thu Jun 28, 2012 6:36 pm    Post subject:
Reply with quote

Well, when you get your ACTUAL text here we may be able to look at it.
Back to top
View user's profile Send private message
raju.mopidevi

New User


Joined: 18 Sep 2011
Posts: 12
Location: India

PostPosted: Fri Jun 29, 2012 3:39 pm    Post subject:
Reply with quote

Nic,

My Actual program calls DMBATCH uses SUBMIT proc which internally calls GETTXTFL PROC

Code:

ADDRESS ISREDIT "MACRO"
Address TSO
"Allocate DDN(TSOLIB) SHR REUSE DSN(' my tso lib pds ')"
"Allocate DDN(DMNETMAP) SHR REUSE DSN(' my netmap ')"
"Allocate DDN(DMMSGFIL) SHR REUSE DSN(' my msgfil lib ')"
"Allocate DDN(DMPUBLIB) SHR REUSE DSN(' my DMPUBLIB ')"
"Allocate DDN(SYSIN) SHR REUSE DSN(' PS file with SUbmit Proc ')"
"Allocate DDN(DMPRINT) SHR REUSE DSN(' output report file ')"
Address ISPEXEC "SELECT PGM(DMBATCH) PARM('YYLLYNN')"
if rc=0 then
say "your file transferred"
"FREE FI(DMNETMAP DMPRINT TSOLIB )"
"FREE FI(DMMSGFIL DMPUBLIB SYSIN DMPRINT)"
EXIT


Submit PROC
Code:
  SIGNON CASE=YES USERID=<myID,pwd>
  SUBMIT PROC=GETTXTFL    -
     SNODE=unixservername -
     &PDSN=mainframe file -
     &SDSN='/storage/report.txt'
  SIGNOFF


GETTXTFL proc
Code:

GETTXTFL PROCESS  -
STEP01 COPY  -
FROM(SNODE  -
  DSN=&SDSN -
  DISP=SHR -
 )COMPRESS EXT -
TO(PNODE -
  DSN=&PDSN -
  SYSOPTS=":DATATYPE=TEXT:XLATE=NO:STRIP.BLANKS=NO" -
  DCBINOF='DCB=(DSORG=PS, RECFM=U)' -
  DISP=RPL,CATLG,DELETE)
EXIT
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Fri Jun 29, 2012 9:01 pm    Post subject:
Reply with quote

I see that it is an ISPF edit macro that kicks all this off. Is the file being transferred the one being edited? Has this exact process been used before or is this the first time and you are debugging it?
Back to top
View user's profile Send private message
raju.mopidevi

New User


Joined: 18 Sep 2011
Posts: 12
Location: India

PostPosted: Fri Jun 29, 2012 9:23 pm    Post subject:
Reply with quote

Nic,

This is program logic but not the file being transferred.
I want to get this file '/storage/report.txt' from UNIX to the mainframe.

BTW, this program works when I copy mainframe file to UNIX. I am facing RC=8 when I tried to copy a file from UNIX to mainframe.

I think, I made a mistake in the PROC GETTXTFL. But unable to find out !
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jun 29, 2012 9:52 pm    Post subject:
Reply with quote

when i used the interactive c:d
i could either
sign-on to a tso session of the source node
and push the file to the destination

or sign-on to a tso session of the destination node
and pull the file to the destination.

soooooo,
you said:
you can send the file from mf to unix

why don't you receive the file on the mf from the unix?
thereby triggering a 'new' file on mf to start a task
Back to top
View user's profile Send private message
raju.mopidevi

New User


Joined: 18 Sep 2011
Posts: 12
Location: India

PostPosted: Fri Jun 29, 2012 10:00 pm    Post subject:
Reply with quote

dbzTHEdinosauer wrote:
when i used the interactive c:d
i could either
sign-on to a tso session of the source node
and push the file to the destination

or sign-on to a tso session of the destination node
and pull the file to the destination.



You are correct mate.
I am able to push the file from mainframe to UNIX.
but I am not able to pull the file from UNIX to mainframe.

As UNIX is creating the file without asking the file attributes, I am able to push the file. But I have to provide DCB info while creating the file in mainframe( Am I wrong here ? is it necessary to give DCB info?). I have tried several time by modifying the DCB info in SUBMIT proc. But I am unable to pull the file from UNIX.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jun 29, 2012 10:15 pm    Post subject:
Reply with quote

i found with c:d,
anytime i transferred a file from one op-sys to another,
it was just easier to
create (via mod in a iefbr14) the file
then overwrite with the c:d
and did not bother cluttering up my control cards with dcb garbage
it was easier to control the dcb parms on the iefbr14 step.
but thats me.
Back to top
View user's profile Send private message
raju.mopidevi

New User


Joined: 18 Sep 2011
Posts: 12
Location: India

PostPosted: Fri Jun 29, 2012 10:33 pm    Post subject:
Reply with quote

Are you recommend me to use IEFBR14 utility in SUBMIT PROC ? Can you explain me in detail?

Can you share me any ebooks which include C : D with IEFBR14
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jun 29, 2012 10:48 pm    Post subject:
Reply with quote

explanation of iefbr14

in the iefbr14 step, have a dd for your 'destination file'
which will be overwritten (replaced) by the d:c step.
i always use DISP=(MOD,CATLG,DELETE)
and
the appropriate dcb parms.

then when the d:c step runs,
the file is cateloged and can be found by the d:c task.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jun 29, 2012 11:01 pm    Post subject:
Reply with quote

you do realize a successful outcome of your batch c:d step
means
that all you have done
is hang a request on the input queue
for the c:d started task
that actually performs the transfer,
which
depending on the load of your system in general
and c:d stated task in particular,
(and who is tasked with support) icon_razz.gif
can be seemingly simultaneous with the end of your batch job
or hoooouurrrrsss later.
Back to top
View user's profile Send private message
raju.mopidevi

New User


Joined: 18 Sep 2011
Posts: 12
Location: India

PostPosted: Mon Jul 02, 2012 4:19 pm    Post subject:
Reply with quote

I found two mistakes in the GETTXTFL.

I misplaced the keyword "EXIT" in column 1. I didn't added "HOLD=NO".
Now I corrected both mistakes
1. EXIT keyword moved to column 3
2. HOLD=NO added as a row 2 in GETTXTFL

So now the RC=0. But file did not copied to the mainframe.
I have checked NDMCMDS log, no error message. It says "successful".
Do we need to allocate the file manually by ALLOCATE command OR will it be allocated by C : D during copying process?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Mon Jul 02, 2012 4:34 pm    Post subject:
Reply with quote

Have you checked the CDLOG of the started task? You have only checked your batch job - the actual transfer, as you have already been told, is done by the started task (possibly called NDM) and may occur somewhat later than the end of your job. Your job only asks NDM to do the transfer - it does not wait for the transfer to be done. The log for the actual transfer is recorded in CDLOG of the NDM started task.
Back to top
View user's profile Send private message
raju.mopidevi

New User


Joined: 18 Sep 2011
Posts: 12
Location: India

PostPosted: Mon Jul 02, 2012 6:45 pm    Post subject:
Reply with quote

Nic,

Yes, I have added this code & verified NDM log too
Code:
"Allocate DDN(NDMCMDS) SHR REUSE DSN('*')"


This log is combined log of NDM & CD. I have used "TRACE R" in my REXX CODE.
Code:

SELECT PGM(DMBATCH) PARM('YYLLYNN')"
SCANNING FOR CASE KEYWORD
LENGHT OF STRING :      31
STRING BEING SCANNED SIGNON CASE=YES USERID=<my id>
SIGNON COMMAND FOUND
CASE KEYWORD FOUND
CASE =YES OVERRIDE IN AFFECT
COMMAND DOES NOT SAY FOLD
CD/API VER RLSE MOD=40,800 PUT LEVEL=4802
SIGNON GLOBAL CASE=YES
API NETMAP = < our mainfram net map library location >
REETTING ASE FLAGS
GLOBAL CASE=YES IN AFFECT
SCANNING OFR CASE KEYWORD
LENGHT OF STRING :     102
STRING BEING SCANNED
SUMIT PROC=GETTXTFL SNODE=<unix server name> &pdsn=<destination filename> &SDSN='/storage/report.txt'
***** GLOBAL CASE=YES ******
DEFAULT CASE DIRECTION IS MIXED (CASE=YES)
SCANNING FOR CASE KEYWORD
LENGTH OF STRING:     184
STRING BEING SCANNED
STEP01 COPY FROM(SNODE DSN='/storage/report.txt' ) to (PNODE DSN=<destination mainframe ps file location SYSOPTS=":DATATYPE=TEXT:XLATE=NO:STRIP.BLANKS=NO" DCB=(DSORG=PS,RECFM=U) DISP=(RPL,CATLG,DELETE) )
****** GLOBAL CASE=YES ******
DEFAULT CASE DIRECTION IS MIXED (CASE=YES)
DMCBCOPY D1DDSN SET BLKSIZE=2C0A
6AD9
4444 4444 44
0000 0000 00
DMCBCOPY D1NCP=...D1FLAG7=00
RESETTING CASE FLAGS
GLOBAL CASE=YES IN AFFECT
SCANNING FOR CASE KEYWORD
LENGHT OF STRING   6
STRING BEING SCANNED EXIT
***** GLOBAL CASE = YES ****
DEFAULT CASE DIRECTION IS MIXED (CASE=YES)
RESETTING CASE FLAGS
GLOBAL CASE=YES IN AFFECT
SCANNING FOR CASE KEYWORD
LENGTH OF STRING   6
STRING BEING SCANNED : PEND
***** GLOBAL CASE = YES ****
DEFAULT CASE DIRECTION IS MIXED (CASE=YES)
RESETTING CASE FLAGS
GLOBAL CASE=YES IN AFFECT
SCANNING FOR CASE KEYWORD
LENGTH OF STRING   9
STRING BEING SCANNED : SIGNOFF
***** GLOBAL CASE = YES ****
DEFAULT CASE DIRECTION IS MIXED (CASE=YES)
API NETMAP = < mainframe netmap lib location >
GLOBAL CASE=YES IN AFFECT
IF RC=0
"1"
THEN
SAY "YOUR FILES(S) IS/ARE TRANSFERRED SUCCESSFULLY !!"
YOUR FILES(S) IS/ARE TRANSFERRED SUCCESSFULLY !!
Back to top
View user's profile Send private message
Pete Wilson

Active User


Joined: 31 Dec 2009
Posts: 437
Location: London

PostPosted: Mon Jul 02, 2012 6:54 pm    Post subject:
Reply with quote

If it says RC=0 then it must have created something on the mainframe. It's not as simple as the target mainframe file inheriting your TSO DI prefix as the HLQ is it?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
This topic is locked: you cannot edit posts or make replies. Urgent Mainframe Requirments (2-10 yr... Shankar779 Mainframe Jobs 0 Sun Nov 27, 2016 1:48 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us