Page 1 of 1

Replacing carriage return line feed with line feed in C:D

PostPosted: Sat Dec 14, 2013 9:33 am
by saikat09
Hi,

Is it possible to replace carriage return line feed with just line feed while doing text transfer using connect direct from mainframe to unix?

Saikat

Re: Replacing carriage return line feed with line feed in C:

PostPosted: Sat Dec 14, 2013 4:32 pm
by NicC
If by mainframe you mean z/OS and not USS then mainframe does not use CRLF. It uses the LRECL from the DCB info (or the RDW for VB files). So where are you getting your CRLFs from?

Re: Replacing carriage return line feed with line feed in C:

PostPosted: Sat Dec 14, 2013 6:20 pm
by Robert Sample
What did the product documentation tell you when you read it?

FTP, for example, allows the end-of-line terminator to be specified. Whether or not this can be done with Connect:Direct, however, requires someone look at the documentation. As long as your site is licensed for the product, you have access to the documentation -- via hard copy at your site, or an internal web site, or by contacting the vendor to read or download the documentation. An answer on this forum will depend upon someone using the same product to accomplish the same task and being willing to respond -- an answer from the documentation merely requires you to find it and read.

Re: Replacing carriage return line feed with line feed in C:

PostPosted: Sun Dec 15, 2013 10:45 am
by saikat09
The CRLF are embedded in mainframe[Z/OS] files by application programs. I can replace CRLF by LF programatically before pushing the file for C:D. But I would like to know if its possible to handle this via C:D. If there is any unix command to replace CRLF with LF which can be invoked via C:D runtask or some other alternative approach. I have read the product documentation but couldn't find the exact answer to my question.

Re: Replacing carriage return line feed with line feed in C:

PostPosted: Sun Dec 15, 2013 11:35 pm
by NicC
As the CRLF is the Dos line end and LF is the unix one you can try running the file through the dos2unix utility which does this conversion for you. Whether you can call this from C:D I do not know.

Re: Replacing carriage return line feed with line feed in C:

PostPosted: Mon Dec 16, 2013 4:25 pm
by saikat09
I am not using Dos. I am transferring file from mainframe to unix. Below is C:D script:-

CDEMDOUT PROCESS PNODE=&PNODE SNODE=&SNODE
SYMBOL &PCFILE="&ACK"
STEP1 COPY FROM(PNODE DSN=&DSN1 -
DISP=SHR) -
TO(SNODE DSN=&PCFILE -
SYSOPTS=":strip.blanks=no:" -
DISP=RPL -
TYPE=TEXT) -
CKPT=100K -
COMPRESS
IF (STEP1 > 0) THEN
STEP2 RUN TASK (PGM=MDNOTIFY) PNODE
EIF

Please let me know what ammendment is required in this script to replace CRLF with LF.

Re: Replacing carriage return line feed with line feed in C:

PostPosted: Mon Dec 16, 2013 5:47 pm
by NicC
No one said you were using DOS but CRLF is the DOS line-end identification. This can be converted to *nix line-end (LF) using the utility dos2unix which runs under *nix so transfer your file to *nix and run it through dos2unix and you have nice *nix line-end characters. The alternative is to get whatever produces the dataset in the first place to produce the correct line-end sequence for your requirement rather than trying to shoe-horn in a kludge that should not really be needed.