Sending files to AS/400 from Unix

35 pts.
Tags:
AS/400
Connect:Direct
Unix
I am trying to send a file from Unix environment to AS400 using Connect Direct, can somebody help me out with some sample scripts / commands for the same.

Also is there is some way to confirm the connectivity established between the servers using Connect Direct, is there some command to find that out.

Am new with Connect Direct so request your help.



Software/Hardware used:
Connect Direct
ASKED: August 18, 2009  4:01 AM
UPDATED: April 5, 2010  9:27 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Connect Direct eh?

I had to do an interface with this onto i5. It wasn’t fun, and it wasn’t pretty.

All I can remember is that we needed folders for the files to be sent/received, and the geeks in commsland had to set up some connectivity.

We eventually found a really really helpful and knowedgeable IBM bloke who hand held a couple of transmissions to prove the systems were connecting before we got into the gore of the actaul data interpretation.

Sorry I can’t recall much more about it – that was then, and this is now.

General comms stuff applies. Take small steps. Expend lots of energy on establishing the connection reliably before you worry about the data.
Ensure plenty of diagnostics and restart for troubleshooting / operators, and build in some metrics on times and turnrounds / number of records etc.

————————————————————————————————————————–

I have made certain changes in the script and was able to move ahead, but have got stuck with some other error now.

The changed scripts are as below.

submitSend.sh
——————–
CLI_BASE=/sysp/cdunix
NDMAPICFG=$CLI_BASE/ndm/cfg/cliapi/ndmapi.cfg
export NDMAPICFG

if [[ -z $1 ]]
then
echo Please specify the Process file name
echo Syntax: test3.sh [Process file]
return 0
fi

$CLI_BASE/ndm/bin/direct << EOJ
submit file=test3.sh;
EOJ

test3.sh
———-
#!/usr/bin/ksh
CSHN01 process snode=CD.AS400.TST snodeid=(username,pwd)

copystep copy from (file=/source/folder/sftptest.txt
pnode
to (file=/destination/folder
sysopts=”TYPE(MBR)”
disp=(rpl)
snode)

if (copystep==0) then
taskstep run task pnode sysopts=”echo file send to remote host”
else
run task pnode sysopts=”echo file cannot send to remote host”
eif
pend

After executing the submit process script, the error am encountering is as below.

Export is done
submitSend.sh: [[: not found

************************************************** ****
* *
* Connectirect for UNIX *
* *
*—————————————————-*
* Copyright (c) 1992, 2006 Sterling Commerce, Inc. *
* Version 3.8.00 *
************************************************** ****

Enter a ‘;’ at the end of a command to submit it. Type ‘quit;’ to exit CLI.

Direct> **** Error returned…

XPAE003I Return Code: 8 Feedback: 0
:&KEYWD=snode:

XPAM001I Return Code: 8 Feedback: 0
Errors Parsing

Direct>
Connectirect CLI Terminated…
$

Do let me know if anybody has any clues about this.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Yorkshireman
    The phrase 'Errors parsing' suggests a syntax error ?? maybe
    5,520 pointsBadges:
    report
  • Piyushsanghvi
    Is it possible to CD files from Unix to AS400 using AS400 programming? If yes, I need it urgently. Please any one can help!!!!!!!
    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following