Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

FTP : Get the xml file from windows to Mainframe

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Thu Feb 23, 2012 4:01 pm    Post subject: FTP : Get the xml file from windows to Mainframe
Reply with quote

Hi, I am stuck with one FTP.
Requirement is - Get the xml file on windows server to mainframe dataset

FTP commands -
userlid
pwd
cd dir1
cd subdir1
LOCSite FWFriendly
get Testinput.xml 'test.data.set.name'
dir
quit


Problem I have is - Whole file is getting downloaded as a single record, I am able to see only one record.

Here are the options I tried
LOCSite FWFriendly
LOCStat FWFriendly
locsite lrecl=80 unit=test SBSENDEOL=CRLF (LF and CR are tried individually)

a) locstat WRAPrecord (With these a and b options, I am seeing multiple records but XML is wrapped into 80 bytes, tags are broken into 2 lines)
b) locsite lrecl=80


LOCSTAT details are -
Trace: FALSE, Send Port: TRUE
Send Site with Put command: TRUE
Connected to:**.**.**.** , Port: FTP control (21), logged in
Local Port: 12793
Data type:a, Transfer mode:s, Structure:f
No automatic recall of migrated data sets.
No automatic mount of direct access volumes.
Data set mode. (Do not treat each qualifier as a directory.)
ISPFSTATS is set to TRUE
Primary allocation 45 tracks, Secondary allocation 30 tracks.
Partitioned data sets will be created with 15 directory blocks
FileType is SEQ (Sequential - the default).
Number of access method buffers is 5.
Confidence level of data transfers is neither checked nor reported
ENcoding is set to SBCS
SBDataconn codeset names: IBM-037,IBM-850
Outbound SBCS ASCII data uses CRLF line terminator
Outbound MBCS ASCII data uses CRLF line terminator
local site variable UNICODEFILESYSTEMBOM is set to ASIS
local site variable MBREQUIRELASTEOL is set to TRUE
local site variable REMOVEINBEOF is set to FALSE
DBSUB is set to FALSE
SBSUB is set to TRUE
SBSUBCHAR is set to SPACE
RDW's from VB/VBS files are discarded.
Records on input tape are unspecified format
Data sets will be allocated like data set 'MODEL'
Trailing blanks in records read from RECFM F datasets are discarded.
Record format: FB, Lrecl: 80, Blocksize: 27920.
Data not wrapped into next record.
Truncated records will not be treated as an error.
Data connections for the client are not firewall friendly.
local site variable EPSV4 is set to FALSE
local site variable SECUREIMPLICITZOS is set to TRUE
local site variable TLSRFCLEVEL is set to DRAFT
local site variable READVB is set to LE
local site variable LISTSUBdir is set to TRUE
local site variable PROGRESS is set to 10
local site variable SEQNUMSUPPORT is set to FALSE


I searched the forum, find publib links, those are the options I tried. Can you suggest me. Let me know if anything else i need to provide here
Regards
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Feb 23, 2012 4:26 pm    Post subject: Reply to: FTP : Get the xml file from windows to Mainframe
Reply with quote

My (limited) experience with XML data files is that they usually ARE a single record. Unless that can be changed, I'd stick with wrapping the records, and let the downstream application figure out how to unwrap them properly.
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Thu Feb 23, 2012 4:36 pm    Post subject:
Reply with quote

Ok, if so as you said my cobol program has to take care of rest of the things. thanks for your input.

But I tried on thing, copied that xml to my local machine and changed the format from .xml to .txt and regualr FTP just with GET command placed the file onto mainframe as a regular FLAT file (properly ended on closing tags)

So, I sampled the same when downloading from server itself, like - renamed the xml and then downloaded, again it downloded as single record.
looks like i need to work on the program stuff then.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Feb 23, 2012 5:13 pm    Post subject: Reply to: FTP : Get the xml file from windows to Mainframe
Reply with quote

Since the mandatory record break delimiter is a Carriage-Return/Line-Feed (0d0a hex), I'm curious as to what your file contains.
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Thu Feb 23, 2012 5:27 pm    Post subject:
Reply with quote

File has court related details; every tag has one one fields on it.
encoding="utf-8" - if string missing on first tag of XML, does that cause this line break problem? Im not sure, but just checking.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Feb 23, 2012 6:29 pm    Post subject: Reply to: FTP : Get the xml file from windows to Mainframe
Reply with quote

Take a Hex Dump of the ASCII file. That's the best way to review the actual content.
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Thu Feb 23, 2012 6:31 pm    Post subject:
Reply with quote

Yes, I will do that. Thanks for the clue.
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 985
Location: Oostende, Belgium

PostPosted: Thu Feb 23, 2012 7:17 pm    Post subject:
Reply with quote

Pre-allocate your z/OS dataset with whatever lrecl you want. I think the z/OS XML parser will still treat the data as a continuous stream of bytes.
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Thu Feb 23, 2012 7:58 pm    Post subject:
Reply with quote

I have compared the HEX values, looks like there are no X'40' s oonce the tag is over. That might be the reason because when X'40's are there at end I was able to FTP as regular file (one line has one complete start-tag, body and end-tag).

I tried to allocate the file with lrecl=80, data is getting truncated as the whole file is coming in single record. I got only one record it has starting tag thats all. I am new to Z/OS parser, does it come when I am FTPing file to mainframe?

Regards
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Thu Feb 23, 2012 8:42 pm    Post subject: Reply to: FTP : Get the xml file from windows to Mainframe
Reply with quote

It was suggested bu superk that you look at the ASCII file, the one on the Windows server. Are you saying you see EBCDIC there, like the X'40'?

What does it "look" like when you view the file on the server? One record, or many? If many, there will be a delimiter character(s) which you will be able to identify the value(s) of if you look at that in hex.
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Thu Feb 23, 2012 9:32 pm    Post subject:
Reply with quote

Yes, those are EBCDIC. I will check the ASCII values dump. On server, the xml file looks as a single record
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Thu Feb 23, 2012 9:50 pm    Post subject:
Reply with quote

Bang_1 wrote:
Yes, those are EBCDIC. I will check the ASCII values dump. On server, the xml file looks as a single record


So how would you expect some general-purpose utility to do anything but transfer as one record?
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Thu Feb 23, 2012 10:06 pm    Post subject:
Reply with quote

We are the in the process of conveying this to counter-part that they need to some thing so that XML tags come in multiple records. But, we tried all options before conclude like this. Thanks for all inputs.
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Fri Feb 24, 2012 1:26 am    Post subject:
Reply with quote

There are lots of tools now for the manframe to "consume" the XML as a stream using a TCP/IP connection. I know DB2 and IMS already have one.

I don't know your situation, or what the final "consumer" of the XML is, but you should check to see if they already have one running.

It's a bit of a paradigm shift to think of the entire XML document as one discrete entity. It's really hard not to want to break it into records.
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Fri Feb 24, 2012 7:56 am    Post subject:
Reply with quote

I need to create a flat transaction file using the data fields on xml, which will be processed by batch cycle.
After talks with counterpart, we got new xml file from unix box which is loaded into mainframe (using just GET command and LOCSITE with LRECL) as a file with each tag is placed in to individual line. We need to check with them what was exactly they changed and need to figure out what caused this problem. Thanks to all of you for your valuable thoughts.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
This topic is locked: you cannot edit posts or make replies. Urgent Mainframe Requirments (2-10 yr... Shankar779 Mainframe Jobs 0 Sun Nov 27, 2016 1:48 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us