Base64 Encoding from within Natural program

Hello,

We switched our Nat./ADABAS application from Mainframe to Unix last March.
Now I have the following idea to automate some daily/monthly data exchange tasks, i.e. sending certain information or files to certain clients as email attachments or content. OK mostly such things are done via automated ftp transfers, but there is still one or the other guy who wants a certain report emailed - and these manual things are the ones that really waste your time when you have to do them daily or on month-end.

Principally I’d like to be able call one of our own XML webservices via RPC from within the Natural batch program that creates the file or information,
or alternatively I’d customize regular data transfer tasks for a certain batch job group in an administration table together with a search string for the file names I’ll have to dispatch, email addresses etc, then work off these ‘email tasks’ in the last program step of the batch jobs.

The webservice I intend to use takes the necessary info like title, email address etc. as input parameters and content, and dispatches the email. It returns an empty message body if the dispatch was successful, and otherwise an error.
The files that I would like to dispatch embedded or as attachment, will be mostly text or csv files, possibly also pdf’s.
However, I’ll need to transfer such files into a Base64 encoded string to be able to use the web service.

My question is: Can the Base64 encoding be done in - or from within - a Natural program, e.g. by a Unix shell command call? (I didn’t find anything in the Natural help nor in this discussion board, pls let me know if I should have overlooked something to this topic. )

Thanks in advance for any hint, and kind regards :slight_smile:

Eva

I got no experience with webservices@Natural. But maybe, the Unix-command uuencode helps…

Hello Matthias,

thanks for the hint.
I have checked re. the Unix-command uuencode, and I’ll try it out in any case - though I’m not sure if it’s the same as Base64 encoding.

Eva

man uuencode on my Solaris-host says:

man uuencode on Linux (SLES10) says:

So -m seems to be standard in the Unix/Linux-world. On command line it goes like this:

echo "this text into attachment" | uuencode -m name_of_attach.txt | mailx -s "this is my subject" user@host.com

Thanks Matthias, seems I’ve overlooked this -m !

Kind regards

Eva