IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

NAK is getting added FTP from Mainframes


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pinakimishra

New User


Joined: 21 Jul 2007
Posts: 24
Location: phoenix

PostPosted: Thu May 16, 2024 7:22 am
Reply with quote

I have few files which I am doing FTP from Mainframes to Distributed filesystem in Binary mode. For most of the files it works fine but for few files the data is getting truncated and an NAK is getting after each record. For some other files even data is not getting truncated but still NAK is getting added after each record.

These files are simple characters without any COMP-3, COMP etc.
Code:


For example I am sending a file which is of 26 characters but when I am doing SFTP a character 'NAK' (negeative acknowledgement gets added) .

I/P
Code:


2015-05-08-13.58.48.970629
2015-05-08-13.58.48.970742
2015-05-08-13.58.48.970745
2015-05-08-13.58.48.970746
2015-05-08-13.58.48.970747
2015-05-08-13.58.48.970748
2015-05-08-13.58.48.970749
2015-05-08-13.58.48.970750
2015-05-08-13.58.48.970752
2015-05-08-13.58.48.970753



O/P in Distrbuted system

Quote:
ענסץ`נץ`נר`סףKץרKפרKשקנצעשענסץ`נץ`נר`סףKץרKפרKשקנקפעענסץ`נץ`נר`סףKץרKפרKשקנקפץענסץ`נץ`נר`סףKץרKפרKשקנקפצענסץ`נץ`נר`סףKץרKפרKשקנקפקענסץ`נץ`נר`סףKץרKפרKשקנקפרענסץ`נץ`נר`סףKץרKפרKשקנקפשענסץ`נץ`
נר`סףKץרKפרKשקנקץנענסץ`נץ`נר`סףKץרKפרKשקנקץעענסץ`נץ`נר`סףKץרKפרKשקנקץף


The 27th character has NAK

hex value of i/p file
Code:


2015-05-08-13.58.48.970745
FFFF6FF6FF6FF4FF4FF4FFFFFF
2015005008013B58B48B970745
 ----------------------------
2015-05-08-13.58.48.970746
FFFF6FF6FF6FF4FF4FF4FFFFFF
2015005008013B58B48B970746
 ---------------------------
2015-05-08-13.58.48.970747
FFFF6FF6FF6FF4FF4FF4FFFFFF
2015005008013B58B48B970747
 -----------------------


I don't see any special characters

The file is a simple FB File.

General Data
Management class . . : TSTPR
Storage class . . . : TSTP
Volume serial . . . : TST549
Device type . . . . : 3390
Data class . . . . . : STANDARD
Organization . . . : PS
Record format . . . : FB
Record length . . . : 26
Block size . . . . : 27976
1st extent cylinders: 1
Secondary cylinders : 1
Data set name type :
Data set encryption : NO


When I send them as ASCII the they transmit properly. If I am doing FTP with subcommand RECORD then the FTP is successful without the NAK getting added. Not sure whats the issue with these files and how RECORD is able to resolve the issue.

Any suggestions will be helpful. All these are happening to files which are simple display characters. What's the advantage and disadvantage of RECORD mode. I have some big files which have COMP-3 fields. Not sure if adding RECORD to those will impact anyway. I can do some test o performance of those but will like to understand what is the difference and how the RECORD mode is able to resolve the issue.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1281
Location: Bamberg, Germany

PostPosted: Thu May 16, 2024 9:32 am
Reply with quote

You did not mention what commands for transfer you are using.
Back to top
View user's profile Send private message
pinakimishra

New User


Joined: 21 Jul 2007
Posts: 24
Location: phoenix

PostPosted: Thu May 16, 2024 7:26 pm
Reply with quote

Below id the FTP Card

RS;;distributed.sever.net;;
RU;;user_id;;
RC;binary;;
record;;
RC;CD;/directory_name/pinaki;;
PUT;put;TSTB.S.PINAKI.DATAFILE.DETL;DATAFILE;;
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2051
Location: USA

PostPosted: Thu May 16, 2024 8:05 pm
Reply with quote

You transfer the text coded as EBCDIC codepage, in binary mode.

The received binary bytes you consider as if they were coded in (most likely, but need to be verified) ASCII codepage.

So, all originally sent EBCDIC text characters in you example are converted into a sort of garbage.

The value X'15' you consider as NAK in ASCII, but it was sent as NL (new line) in EBCDIC.

Please, learn about the differences in multiple codepages currently in use. It is a big headache, but nevertheless...
Back to top
View user's profile Send private message
pinakimishra

New User


Joined: 21 Jul 2007
Posts: 24
Location: phoenix

PostPosted: Fri May 17, 2024 4:31 am
Reply with quote

I am still not able to understand how they work with Record. Also I have around 20 of these files and only 5 or 6 of them have these kind of issues which gets resolved if I send them with subcommand record. I was assuming even though the files have all characters but still the codepagte is binary and I am doing ftp in binary mode and reading them as binary so there should be any issue as I am not using any ASCII conversion nor reading them as ASCII
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2051
Location: USA

PostPosted: Tue May 21, 2024 12:48 am
Reply with quote

It would be nice if you presented here ALL the code you have used, plus ALL error messages and ALL logs you have received.

Nobody here is going to do YOUR OWN job instead of you, and/or to guess something you try to keep in secret for unknown reason.
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 158
Location: Kuala Lumpur

PostPosted: Tue May 21, 2024 8:50 am
Reply with quote

RECord subcommand—Set the file structure to record

Use the RECord subcommand to set the file structure to record. This is quivalent to specifying the STRucture R subcommand.

Quote:
File structures
File organization is specified using the STRU command. The following file structures are defined in section 3.1.1 of RFC959:

F or FILE structure (stream-oriented). Files are viewed as an arbitrary sequence of bytes, characters or words. This is the usual file structure on Unix systems and other systems such as CP/M, MS-DOS and Microsoft Windows. (Section 3.1.1.1)
R or RECORD structure (record-oriented). Files are viewed as divided into records, which may be fixed or variable length. This file organization is common on mainframe and midrange systems, such as MVS, VM/CMS, OS/400 and VMS, which support record-oriented filesystems.
P or PAGE structure (page-oriented). Files are divided into pages, which may either contain data or metadata; each page may also have a header giving various attributes. This file structure was specifically designed for TENEX systems, and is generally not supported on other platforms. RFC1123 section 4.1.2.3 recommends that this structure not be implemented.
Most contemporary FTP clients and servers only support STRU F. STRU R is still in use in mainframe and minicomputer file transfer applications.


STRU R should only be used for structured files. Once this command is issued, ascii and binary transfers cannot be done. The latter will result in the error message: "STRU R can only be used to read/write from/to structured files"
STRU F should be subsequently issued to transfer ascii/binary
files.

So to simply this, when you use "RECORD" subcommand, you are changing the Structure to R, which will change FTP transfer of ASCII and BINARY to EBCDIC. I can not comment on how some of the files are working or not working without further information.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts SH256/MD5 Checksum in Mainframes JCL JCL & VSAM 14
No new posts After hours quick-fix support for IBM... Mainframe Jobs 0
No new posts How to remove one row and can be adde... All Other Mainframe Topics 2
No new posts Data for newly added fields not displ... IMS DB/DC 6
No new posts New Parameter should be added to the ... CLIST & REXX 30
Search our Forums:

Back to Top