Copying USS-File using SORT

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
Martin G.
Member
Posts: 7
Joined: Thu Mar 11, 2010 6:39 pm

Copying USS-File using SORT

Post by Martin G. » Fri Apr 16, 2010 4:13 pm

Hello to the forum,

hope you can help solving the following problem:
We used to copy a file from USS to MVS using SORT because of it's excellent performance. The SORTIN-File had a xml-like format with CRLF added after every end-tag.
That's how the JCL looks like
//*
//SORTIN DD PATH='&PATHNAME.&FILENAME',
// PATHOPTS=ORDONLY,RECFM=VB,LRECL=1307,FILEDATA=TEXT
//*
//SORTOUT DD DSN=...filename...,
// DISP=(NEW,CATLG,DELETE),
// LRECL=2996,RECFM=VB,BLKSIZE=3000,
// &SPAC#L1,UNIT=(3390,10)
//*
//SYSOUT DD SYSOUT=*
//*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FTOV
/*
assuming the length of a line will never be longer than 1307 Bytes, with was fine until now.
Now the format of SORTIN was changed, it is now a real XML-File, which means there are no CLRFs, but it is only one long line of daily varying unknown length.
The SORT-Step now ends with 'WRONG LEN RECRD' (of course) or, when LRECL ist omitted with 'SORTIN RECFM IS U '.
Is there a possibility to use SORT performance nevertheless, without giving DCBs to SORTIN?

Thanks a lot for your answers!
Martin

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Sun Apr 18, 2010 9:42 am

Well, so far I've never used DCB on SORTIN - what happens when you omit all of them? Do you again get "SORTIN RECFM IS U"?
Regards,
Anuj

Martin G.
Member
Posts: 7
Joined: Thu Mar 11, 2010 6:39 pm

Copying USS-File using SORT

Post by Martin G. » Mon Apr 19, 2010 1:11 pm

Hello Anuj,

first of all, thank you for your answer, and, of course, it is better to leave the job with DCBs to SORT. I already tried omitting all DCB infos, the result is unknown record format error again.
I read a lot and when I got all the informations right, USS-files are treated as BDAM-Files and DCB-parameters are required. But now I think, the 'FILEDATA=TEXT' is the key. If you use it, the system is looking for CLRF, and if there is none in the given LRECL, the 'wrong length' error occurs.
I was successful now copying the file using the 'FILEDATA=BINARY' parameter and a LRECL corresponding to the LRECL of the target file. We still have to verify whether the receiving system can handle this file, i.e. the LRECL is set to the right value, then I think, the problem is solved.

Martin

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Mon Apr 19, 2010 6:09 pm

Good Luck, keep us posted about your final solution... :)
Regards,
Anuj

Martin G.
Member
Posts: 7
Joined: Thu Mar 11, 2010 6:39 pm

Copying USS-File using SORT

Post by Martin G. » Thu Apr 22, 2010 12:49 pm

Hello,

the job works fine now with the following parameters for the SORTIN file:
//*
//SORTIN DD PATH='&PATHNAME.&FILENAME',
// PATHOPTS=ORDONLY,RECFM=F,LRECL=2996,FILEDATA=BINARY
//*
the rest of the JCL remains unchanged.
8)
Have a nice day
Martin

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Thu Apr 22, 2010 1:26 pm

Thanks for a follow-up Martin - so using another LRECL, probably a correct LRECL because of new change, worked out as a final solution?
Regards,
Anuj

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others