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
 

 

problem while uploading log file to mainframe
Goto page 1, 2  Next
 
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 Aug 26, 2010 7:26 pm    Post subject: problem while uploading log file to mainframe
Reply with quote

I have a log file on windows system. looks like this -

1363518*D*20091209*
1363477*A*20091209*
1363470*A*20091209*
1363465*A*20091209*20091214
1363461*A*20091209*
1363455*A*20091209*20091214
1245292*A*20100604*
1245217*A*20100604*
R0000115160*A*20100604*
R0000115045*A*20100604*
R0000115754*A*20100604*20100607
R0000115375*A*20100604*20100607
R0000114925*A*20100604*
R0000114885*A*20100604*


When i am downloading into mainframe, it is getting downloaded in the below fashion with LRECL=80

1363518*D*20091209*1363477*A*20091209*1363470*A*20091209*1363465*A*20091209*200
912141363461*A*20091209*1363455*A*20091209*200912141245292*A*20100604*1245217*A
*20100604*R0000115160*A*20100604*R0000115045*A*20100604*R0000115754*A*20100604*
20100607R0000115375*A*20100604*20100607R0000114925*A*20100604*R0000114885*A*201
00604*

I want the file the way it looks in windows system (mentioned above). Did searched on forum, but didnt find any topic that suits to my requirement.

Here are the batch FTP commands used to download the file.

userid
password
CD StatusFile
locsite RECFM=F FWFriendly WRAPrecord
get logfile.log 'tt.tx.#670.test.log(+1)'
dir
quit

Can anyone guide me?
Thanks
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 Aug 26, 2010 7:43 pm    Post subject: Reply to: problem while uploading log file to mainframe
Reply with quote

Could you post a hex dump of the ASCII file contents, for what you think should be a few records?

Something like this, as an example:

Code:

-d
13BE:0100  31 33 36 33 35 31 38 2A-44 2A 32 30 30 39 31 32   1363518*D*200912
13BE:0110  30 39 2A 20 0D 0A 31 33-36 33 34 37 37 2A 41 2A   09* ..1363477*A*
13BE:0120  32 30 30 39 31 32 30 39-2A 20 0D 0A 31 33 36 33   20091209* ..1363
13BE:0130  34 37 30 2A 41 2A 32 30-30 39 31 32 30 39 2A 20   470*A*20091209*
13BE:0140  0D 0A 31 33 36 33 34 36-35 2A 41 2A 32 30 30 39   ..1363465*A*2009
13BE:0150  31 32 30 39 2A 32 30 30-39 31 32 31 34 20 0D 0A   1209*20091214 ..
13BE:0160  31 33 36 33 34 36 31 2A-41 2A 32 30 30 39 31 32   1363461*A*200912
13BE:0170  30 39 2A 20 0D 0A 31 33-36 33 34 35 35 2A 41 2A   09* ..1363455*A*
-d
13BE:0180  32 30 30 39 31 32 30 39-2A 32 30 30 39 31 32 31   20091209*2009121
13BE:0190  34 20 0D 0A 31 32 34 35-32 39 32 2A 41 2A 32 30   4 ..1245292*A*20
13BE:01A0  31 30 30 36 30 34 2A 20-0D 0A 31 32 34 35 32 31   100604* ..124521
13BE:01B0  37 2A 41 2A 32 30 31 30-30 36 30 34 2A 20 0D 0A   7*A*20100604* ..
13BE:01C0  52 30 30 30 30 31 31 35-31 36 30 2A 41 2A 32 30   R0000115160*A*20
13BE:01D0  31 30 30 36 30 34 2A 20-0D 0A 52 30 30 30 30 31   100604* ..R00001
13BE:01E0  31 35 30 34 35 2A 41 2A-32 30 31 30 30 36 30 34   15045*A*20100604
13BE:01F0  2A 20 0D 0A 52 30 30 30-30 31 31 35 37 35 34 2A   * ..R0000115754*
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7914
Location: Bellevue, IA

PostPosted: Thu Aug 26, 2010 7:45 pm    Post subject:
Reply with quote

Does the log file look like your post in NOTEPAD or are you using a special program to look at it? The behavior you are seeing is consistent with a file that does not contain end-of-record markers (cr/lf on Windows).
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Fri Aug 27, 2010 5:05 pm    Post subject:
Reply with quote

Superk, Hex format looks like this


Code:
1363518*D*20091209*1363477*A*20091209*1363470*A*20091209*1363465*A*200911209*200
FFFFFFF5C5FFFFFFFF5FFFFFFF5C5FFFFFFFF5FFFFFFF5C5FFFFFFFF5FFFFFFF5C5FFFFFFFFF5FFF
1363518C4C20091209C1363477C1C20091209C1363470C1C20091209C1363465C1C200911209C200
 ------------------------------------------------------------------------------ --------------------------------------
912141363461*A*20091209*1363455*A*20091209*200912141245292*A*20100604*12245217*A
FFFFFFFFFFFF5C5FFFFFFFF5FFFFFFF5C5FFFFFFFF5FFFFFFFFFFFFFFF5C5FFFFFFFF5FFFFFFFF5C
912141363461C1C20091209C1363455C1C20091209C200912141245292C1C20100604C12245217C1
 ------------------------------------------------------------------------------ -------------------------------------
*20100604*R0000115160*A*20100604*R0000115045*A*20100604*R0000115754*A*200100604*
5FFFFFFFF5DFFFFFFFFFF5C5FFFFFFFF5DFFFFFFFFFF5C5FFFFFFFF5DFFFFFFFFFF5C5FFFFFFFFF5
C20100604C90000115160C1C20100604C90000115045C1C20100604C90000115754C1C200100604C
 ------------------------------------------------------------------------------ -------------------------------------
20100607R0000115375*A*20100604*20100607R0000114925*A*20100604*R00001148885*A*201
FFFFFFFFDFFFFFFFFFF5C5FFFFFFFF5FFFFFFFFDFFFFFFFFFF5C5FFFFFFFF5DFFFFFFFFFFF5C5FFF
2010060790000115375C1C20100604C2010060790000114925C1C20100604C900001148885C1C201
 ------------------------------------------------------------------------------ -------------------------------------
00604*                                                                         
FFFFF544444444444444444444444444444444444444444444444444444444444444444444444444
00604C00000000000000000000000000000000000000000000000000000000000000000000000000
----------------------------------------------------------------------------------------------------------------


Robert, the log file looks like the way i posted, but if we FTP it to mainframe dataset, its not coming the way it is appearing on windows. not sure whether it has a CR/LF. How do i handle if it doesnt contain any end of record markers?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Aug 27, 2010 5:37 pm    Post subject:
Reply with quote

What kind of logfile would this be? The windows logfile as seen in event viewer?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7914
Location: Bellevue, IA

PostPosted: Fri Aug 27, 2010 5:44 pm    Post subject:
Reply with quote

This file is not a text file -- which has CR/LF (X'0D0A') at the end of each record. It appears there is an X'FC' at the end of the data record -- so you may need to manually deblock the data.
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Fri Aug 27, 2010 5:45 pm    Post subject:
Reply with quote

This is kind of log file that shows event status for one of the clients. we dont have event viewer.
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Fri Aug 27, 2010 5:47 pm    Post subject:
Reply with quote

there is no other way other than manual separation, becasuse this is going to run on daily basis, so checking options to automate the process.
This is a .log file, not .txt file.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7914
Location: Bellevue, IA

PostPosted: Fri Aug 27, 2010 6:25 pm    Post subject:
Reply with quote

By manual, I mean you could write a program in the language of your choice to read each 80-byte record, split it into records based on the X'FC' record delimiter, and write those records into another file. As far as I am aware, there's nothing in z/OS to help you -- although you might check with the SORT people to see if they have a way to handle this data.
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: Fri Aug 27, 2010 6:41 pm    Post subject: Reply to: problem while uploading log file to mainframe
Reply with quote

Robert, this is driving me nuts. Where do you see the x'FC' character? I keep seeing the x'5C' (*).
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7914
Location: Bellevue, IA

PostPosted: Fri Aug 27, 2010 7:11 pm    Post subject:
Reply with quote

Kevin, you're right -- I was misreading the hex values. Serves me right for looking at a screen before I drink my coffee!

Bang_1, based upon my revisited look at the data -- unless you have a tool to create a text file from the log file, there is no practical way for a mainframe to deal with your data file as a production application.
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: Fri Aug 27, 2010 7:29 pm    Post subject: Reply to: problem while uploading log file to mainframe
Reply with quote

I still would've liked to have seen the actual, native, raw ASCII data in hex. I really can't tell what logically distinguishes one record from another, unless it's based strictly on the length of each logical record.
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Mon Aug 30, 2010 3:36 pm    Post subject:
Reply with quote

Thanks for the inputs...
This is what Iam doing now ---
1) Read each character on a record (lets say downloaded to LRECL of 32 file)
2) Go on caoncatinating each & every character until x'15' (which is EOL for this log file in this case)
3) Write the concatinated string on to output file
4) Repeat this process until 32 characters of a record
5) Repeat this process for the whole set of records

Let me know if ay improvements can be done to this process...
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Mon Aug 30, 2010 6:01 pm    Post subject:
Reply with quote

Its working with the above logic, thanks to all for your valuable inputs icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Aug 30, 2010 7:55 pm    Post subject:
Reply with quote

Hello,

If it works, i suppose all is well. . .

Quote:
until x'15'
Where are the x'15's in the posted data? I've not seen one yet. . .

Suggest very thorough testing (rather than just having it work once) be done before this is used for something critical.
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Tue Aug 31, 2010 12:51 pm    Post subject: Reply to: problem while uploading log file to mainframe
Reply with quote

In my earlier post, i have posted how the file looks in HEX format without delimiters.

Log file is downloaded with LRECL of 32. Here is the snapshot of that file in HEX format in mainframe.. Now the file has X'15' on column #20 in line#1. This one used as reference to break the lines...

Few test cases were ran against the code, its breaking fine till now. We have another week of testing, and we will work on corrections, if it doenst break as expected....


Code:
 BROWSE    TT.TX.#670.TEST.LOG.G0071V00               Line 00000000 Col 001 032
 Command ===>                                                  Scroll ===> CSR 
********************************* Top of Data **********************************
                                                                               
                                                                               
 ------------------------------------------------------------------------------
1363518*D*20091209*.1363516*A*20                                               
FFFFFFF5C5FFFFFFFF51FFFFFFF5C5FF                                               
1363518C4C20091209C51363516C1C20                                               
 ------------------------------------------------------------------------------
091209*.1363512*D*20091209*.1363                                               
FFFFFF51FFFFFFF5C5FFFFFFFF51FFFF                                               
091209C51363512C4C20091209C51363                                               
 ------------------------------------------------------------------------------
511*D*20091209*.1363491*A*200912                                               
FFF5C5FFFFFFFF51FFFFFFF5C5FFFFFF                                               
511C4C20091209C51363491C1C200912                                               
 ------------------------------------------------------------------------------
09*.1363477*A*20091209*.1363470*                                               
FF51FFFFFFF5C5FFFFFFFF51FFFFFFF5                                               
09C51363477C1C20091209C51363470C                                               
 ------------------------------------------------------------------------------
"Code'd"
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 31, 2010 8:09 pm    Post subject:
Reply with quote

Hello,

You need to to make sure you use the code tag. . . The way you posted the most recent data was basically unreadable.

Originally there were x'0D0A' values that appear to have become x'15'. . . What caused this?

When i've sent data with x'0D0A' in the data, i get a record break. . .

I'm probably looking at something incorrectly, but it appears this is a moving target.
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: Tue Aug 31, 2010 8:19 pm    Post subject: Reply to: problem while uploading log file to mainframe
Reply with quote

Bang_1, you originally stated that this file originated on a Windows machine, which is one reason why I asked if you could post a hex dump of that data so we'd all know what it looks like as it exists in Windows.

Do you not know how to run a dump of data in Windows? It's relatively easy to do.
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Wed Sep 01, 2010 11:16 am    Post subject:
Reply with quote

Dick, I will use CODE tag from next time onwards...
first i posted ASCII format of file on windows in 2 formats. One shows how it looks on windows, otherone how its in mainframe without delimiters, then superk posted the hex dump of mainframe without delimiters. I think you might have referring to this (X'ODOA').
Again I posted Hex dump on mainframe while I am developing the code on Tue Aug 31, 2010 12:51 pm. This one has the delimiter X'15', which is used as reference to break into lines.... Hope Iam clear....

Superk, we dont have access to windows ftp box apart from batch ftp thru JCL. So didnt i posted the windows dumps.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Sep 01, 2010 7:40 pm    Post subject:
Reply with quote

Hello,

You might do an experiment changing the x'15' values to x'0D' before the upload. . .
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
Goto page 1, 2  Next
Page 1 of 2

 

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