View previous topic :: View next topic
|
Author |
Message |
rahulabvp
New User
Joined: 05 May 2010 Posts: 7 Location: Bloomington, IL, USA
|
|
|
|
I know that maximum length of LRECL parameter is 32K. I want to receive a file of length 300K FTPed by other team.
Please suggest me a solution to create a file of length 300K?
If thats not possible what other options are available.
Rahul |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
What platform is the file coming from? Can the other team create the file with records no more than 32K in length?
Although I haven't tested this, you might be able to transfer the file to a Unix System Services directory and break the records down into 32K or less.
Quote: |
I have a PS file which has length of 120 Characters. i want to read last 26 characters of that file and copy them into another file using JCL Only. |
Sorry, this cannot be done. JCL executes programs. It does nothing but execute programs. It cannot read files, copy files, or do anything else -- all JCL does is execute programs. If you wanted to do this in batch with a utility such as SORT or a program, then it could easily be done. But as stated, your request is not possible. |
|
Back to top |
|
|
rahulabvp
New User
Joined: 05 May 2010 Posts: 7 Location: Bloomington, IL, USA
|
|
|
|
The records are coming from IBUS and FTP team is putting those records into a PS file. I need to create the file of length 300K. If I can create the file then FTP team can put the records into that file.
But not sure how to create such a long file. Please help me.
Thanks,
Rahul |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
Did you read what Robert posted? Suggest you re-read. . .
Also suggest someone implement a process on the sending system to break this data into proper mainframe records. . .
You might be able to do this in USS, but only if you have someone who knows how to work in the environment. The sending system surely has someone who can manipulate data. |
|
Back to top |
|
|
rahulabvp
New User
Joined: 05 May 2010 Posts: 7 Location: Bloomington, IL, USA
|
|
|
|
I dont want message (XML) to be broken into several parts. I want a long single string of 300K so that i can read it. The current length of the file is 80 and hence the XML is broken into many lines. To read this broken XML is difficult as I am going to use XMLPARSE commnad in DB2. Thats why i am asking if file of 300K length can be created or not. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
I know that maximum length of LRECL parameter is 32K. I want to receive a file of length 300K FTPed by other team. |
Unfortunately, you can't always get what you want. The LRECL limit is not optional, is not something you can get around by some trick -- a z/OS (MVS) file has this limit. Period. The only exceptions that I am aware of are ANSI tapes (which I've never even heard of being processed on a z/OS system), variable blocked spanned records (and good luck explaining to someone working on another platform about segment descriptor words), or -- maybe (as I said, not confirmed) -- Unix System Services files in a USS directory.
If none of these options works for you (and the USS option may not work at all -- test it first), then you can either (a) state to the sending team that the file cannot be processed on a mainframe, or (b) have the sending team shrink the records to fit the LRECL limitation. We on this forum have no magic secrets that will allow you to exceed the LRECL size limit. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
NOW the requirement comes out! COBOL quite happily can combine up to 1.5 million 80-byte records into a single array and parse it using XMLPARSE. The code is simple COBOL and works quite well -- I've written it to parse iTunes library data and there are no issues with creating a long string of data and then parsing it.
Since the solution you want is not possible, I recommend you start exploring alternatives. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I am probably missing something, but why can you not simply read the little records, move them into a 300k array and parse this?
Quote: |
I dont want message (XML) to be broken into several parts. |
You are possibly not old enough to remember, but the Rolling Stones made a famous song about this - "You Can't Always Get What You Want". . .
Quote: |
I want a long single string of 300K so that i can read it. |
Send this request to IBM and maybe someday it will be implemented. If it is not already in process, it will take years even if they agree to do what you want - so doing something else now is in order. |
|
Back to top |
|
|
Ronald Burr
Active User
Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
As an alternative, have the sender drop the 300K XML record onto a Message Queue and have your COBOL program Open the MQ, Get the Record(s) into a large ( 300K ) buffer, and XMLPARSE to your hearts content.
Why some folks ( e.g. the sender, in this case ) flagrantly ignore Mainframe restrictions is beyond me. While it would be ludicrous to expect a 5 passenger car to carry 50 passengers, it seems that some folks fully expect that there is a way to get MVS, which has a defined maximum LRECL of 32K, to support an LRECL of 300K. |
|
Back to top |
|
|
candurs
New User
Joined: 12 Dec 2003 Posts: 1
|
|
|
|
The solution is zFS... This sample write 1 megabyte record length
Code: |
******************************
IDENTIFICATION DIVISION.
PROGRAM-ID. MYBCXZFS.
***********************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
INPUT-OUTPUT SECTION.
***********************************************************
FILE-CONTROL.
SELECT FD-ZFSFILE ASSIGN TO ZFSFILE
ORGANIZATION IS LINE SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS WK-ZFSFILE-STATUS.
***********************************************************
...
***********************************************************
FILE SECTION.
*-------------
FD FD-ZFSFILE
RECORD IS VARYING IN SIZE FROM 1 TO 1024000
DEPENDING ON WK-ZFSFILE-SIZE.
01 RC-ZFSFILE.
02 FILLER OCCURS 1 TO 1024000
DEPENDING ON WK-ZFSFILE-SIZE.
05 FILLER PIC X.
***
**************************************************************
WORKING-STORAGE SECTION.
**************************************************************
77 WK-ZFSFILE-STATUS PIC X(02) VALUE SPACES.
**************************************************************
77 WK-ZFSFILE-SIZE PIC 9(05) COMP-5.
**************************************************************
01 WK-ZFSFILE-1MB.
02 FILLER PIC X(10) VALUE '***INIZ***'.
02 FILLER PIC X(1023980) VALUE '12345678'.
02 FILLER PIC X(10) VALUE '***FINE***'.
***
**************************************************************
PROCEDURE DIVISION.
**************************************************************
MAIN SECTION.
*-------------
OPEN OUTPUT FD-ZFSFILE
.
MOVE +1024000 TO WK-ZFSFILE-SIZE
MOVE WK-ZFSFILE-1MB TO RC-ZFSFILE
.
WRITE RC-ZFSFILE
.
IF WK-ZFSFILE-STATUS NOT = '00'
DISPLAY '(WRI3) WK-ZFSFILE-STATUS >' WK-ZFSFILE-STATUS
MOVE 12 TO RETURN-CODE
END-IF
.
CLOSE FD-ZFSFILE
.
|
This is sample JCL
Code: |
//MYBCXZFS EXEC PGM=MYBCXZFS,COND=(0,LT)
//*-------------------------------------------------------------------*
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSDBOUT DD SYSOUT=*
//SYSABEND DD SYSOUT=*
//SYSDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//*-------------------------------------------------------------------*
//ZFSFILE DD PATH='/u/home/ZFSFILE.txt',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// PATHDISP=(KEEP,DELETE),
// PATHMODE=(SIRUSR,SIWUSR,SIRGRP),
// FILEDATA=TEXT
|
TSO 3.17
Code: |
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
z/OS UNIX Directory List Row 69 to 69 of 69
Command ===> Scroll ===> CSR
Pathname . : /u/home/
Command Filename Message Type Permission Audit Ext Fmat
-------------------------------------------------------------------------------
ZFSFILE.txt File rw-r----- fff--- --s- nl
******************************* Bottom of data ***********
|
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
candurs, after 8 years there's probably not a lot of interest in your solution. And the Enterprise COBOL Language Reference manual (version 6.2) gives a limit of 1,048,575 bytes for the FD record description in Appendix B. Compiler limits -- so you're close to the limit with your example. Furthermore, since zFS is a Unix System Services file system type, and USS was mentioned already as a possible solution, you're rehashing material already mentioned. When the requirement is for an MVS data set, not a USS file, then your solution won't provide anything. |
|
Back to top |
|
|
|