Search code examples
ftpsftpmainframessh2-sftp

"Carriage Return" is missing in sFTP file


Upto now we are transferring file from our mainframes to Windows system(Client system) via Normal FTP. My Client is receving the file with "Carriage Return"(CR) and "Line Feed"(LF) at the end of each file..

Now we are changinf the transfer mechanism to sFTP..Below are the steps I am following 1. Copy the PS file to OMVS system of Mainframe. 2. Run the sFTP commands and send the file to Client system.

Now the problem is..My client is along with the data my client is only receving LF ant end of each line..CR is missing.. I have tried options like "ascii dos unix" in the sftp script and "SBSENDEOL CRLF" in JCL..But no luck

Below is the script i am running

ascii
lcd /u/myid
put File1.txt FileNew1.txt
chmod 775 FileNew1.txt
put

Below is how they expect the file to be

Expectedformat file

But this is how the file is received when I run the script I have pasted above

enter image description here

Please let me know if there is option to achieve CR and LF.


Solution

  • I got the solution..Instead of copying file(PS file) from mainframes to USS in mainframes using JCL step like below

    //ST020    EXEC PGM=IKJEFT01,COND=(0,NE)                        
    //SYSTSPRT DD SYSOUT=*                                          
    //SYSPRINT DD SYSOUT=*                                          
    //SYSPUNCH DD SYSOUT=*                                          
    //ICTRL1   DD DSN=PP00.PA0000.CNTL(H123YC1),DISP=SHR        
    //OCTRL1   DD PATH='/u/SPP00/ryc',                              
    //            PATHDISP=(KEEP,DELETE),                           
    //            PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU  
    //SYSTSIN  DD DSN=PP00.PA0000.CNTL(H125CLF),DISP=SHR        
    

    and

    then transfer it using

    ascii lcd /u/myid put File1.txt FileNew1.txt chmod 775 FileNew1.txt

    I have transferred the file dirctly from mainframes to client system(windows), I have used below script for that..

    lcd /u/SPP00/                                       
    !cp -F crnl "//'p125.P123.DEMUT.CSV'" AANBCD   
    put AANBCD   Test_AVBCLKS_20160218_085518.csv
    !rm AANBCD   
    quit             
    

    This has worked like charmm!!!