0

I am sending a file from UNIX to MAINFRAME server via connect direct. I am able to upload the file successfully.At the destination host, when the file is received it is not readable and not in the same format as I sent from the UNIX server.

Below is the transmission job

Direct> Enter a ';' at the end of a command to submit it. Type 'quit;' to exit CLI.

        submit maxdelay=unlimited TINIRS   process    snode=b1ap005
                       TRANSMIT   copy from  (file=myFile.txt
                                              pnode
                                              sysopts=":datatype=text"
                                             )
                                             ckpt=1k
                                       to    (file=myFile.txt(+1)
                                              snode
                                              DCB=(DSORG=PS,RECFM=VB,LRECL=1500)
                                              disp=(new)
                                             )
         pend ; 

Please let me know the DCB values needs to be updated. The file I am sending has 3 records of variable length and the maximum length of record is 1500.

Sachin
  • 20,805
  • 32
  • 86
  • 99
  • I'm not sure this is programming question. You may want Serverfault. You can "flag" your own question for moderator attention to ask it to be moved. – derobert Oct 28 '11 at 15:48
  • Do you need to do anything about ASCII/EBCDIC character conversion? – NealB Oct 28 '11 at 18:26

2 Answers2

1

Actually, that looks almost right. But if your maximum record length is 1500 characters (exclusive of the NL at the end of the line), your LRECL should be at least 1504. But don't skimp on the maximum - there's no cost or penalty to larger values (up to 32767). And NealB's correct - if this is a text file, you may need to specify a character-set translation - but I don't know how to do that in CONNECT:Direct.

Ross Patterson
  • 9,527
  • 33
  • 48
  • On the Unix side, `dd` handles ASCII:EBCDIC — so you can fairly readily reformat the file before sending. – BRPocock Dec 05 '11 at 19:37
  • 1
    Oh, if only it were that easy :-) There are many EBCDIC code pages, and you really need to know which one(s) you're talking about. I lost lots of hair over this issue years ago :-) – Ross Patterson Dec 05 '11 at 20:20
0

C:D automatically converts ascii to EBCDIC when DATATYPE=TEXT is used. To be positive, you may want to use ":datatype=text:xlate=yes:".