Re: Break a dataset into new record boundaries?
There was a drive in PERL-MVS (http://lists.perl.org/list/perl-mvs.html) to work on that stuff, but it looks like that they had to drop EBCDIC support because there were no porters. I myself do not posses the needed expertise, so I did not reply, but you may view the latest email (from a year ago) here: http://www.mail-archive.com/perl-mvs@perl.org/msg01451.html They seem to suggest that one coul;d compile Perl on z/OS, though (sans EBCDIC I assume) Ze'ev Atlas 201-801-0378 201-805-0286 (cell) From: Shmuel Metz (Seymour J.) shmuel+...@patriot.net To: IBM-MAIN@LISTSERV.UA.EDU Sent: Thursday, January 17, 2013 9:52 PM Subject: Re: Break a dataset into new record boundaries? In 1358352865.70255.yahoomail...@web120503.mail.ne1.yahoo.com, on 01/16/2013 at 08:14 AM, Ze'ev Atlas zatl...@yahoo.com said: Don't misunderstand me, I love Rexx... just would want it to have better IO and regular expressions (in z/OS - on other platforms Rexx already has this capability, though in POSIX sematics). To that end, I've ported PCRE to z/OS That should be useful, although it would still be nice to have a current Perl; 4.8.7 is pretty long in the tooth. -- Shmuel (Seymour J.) Metz, SysProg and JOAT Atid/2 http://patriot.net/~shmuel We don't care. We don't have to care, we're Congress. (S877: The Shut up and Eat Your spam act of 2003) -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
In 1358352865.70255.yahoomail...@web120503.mail.ne1.yahoo.com, on 01/16/2013 at 08:14 AM, Ze'ev Atlas zatl...@yahoo.com said: Don't misunderstand me, I love Rexx... just would want it to have better IO and regular expressions (in z/OS - on other platforms Rexx already has this capability, though in POSIX sematics). To that end, I've ported PCRE to z/OS That should be useful, although it would still be nice to have a current Perl; 4.8.7 is pretty long in the tooth. -- Shmuel (Seymour J.) Metz, SysProg and JOAT Atid/2http://patriot.net/~shmuel We don't care. We don't have to care, we're Congress. (S877: The Shut up and Eat Your spam act of 2003) -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
In 1358346823.60155.yahoomail...@web120503.mail.ne1.yahoo.com, on 01/16/2013 at 06:33 AM, Ze'ev Atlas zatl...@yahoo.com said: I would do Perl too, but what if you are limited to Rexx and EXECIO Then I'd grit my teeth and use parse to split the data. In either case the real problem is what heuristic to use to decide whether the match really is the beginning of a record. -- Shmuel (Seymour J.) Metz, SysProg and JOAT Atid/2http://patriot.net/~shmuel We don't care. We don't have to care, we're Congress. (S877: The Shut up and Eat Your spam act of 2003) -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
Hi Charles, if I well understand your question, the following is a solution: //*- //ST002 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * +1+2+3+4+5 +1+...$2+3+4+5 +1+2+3+..$.4+5 +1+2+3+4+5 +1+2+3+4+...$5 /* //SORTOUT DD DSN=X.SORTTRK, // UNIT=SYSDA,DISP=(,CATLG),SPACE=(TRK,1) //SYSIN DD * OPTION COPY INREC PARSE=(%01=(ABSPOS=1,ENDBEFR=C'$',FIXLEN=50)), BUILD=(%01) OUTFIL FTOV,VLTRIM=X'40' /* The output file is: * Top of Data ** -- +1+2+3+4+5 4F4F4F4F4F E1E2E3E4E5 -- +1+... 4F E1EBBB -- +1+2+3+.. 4F4F4F444 E1E2E3EBB -- +1+2+3+4+5 4F4F4F4F4F E1E2E3E4E5 -- +1+2+3+4+... 4F4F4F4F E1E2E3E4EBBB -- Bottom of Data If you don't need the output to be VB, delete the last command line. Trim the FIXLEN command to the maximum you think your record will be (it's only a temp record) and replace the $ with the character delimiting your record. Regards. Massimo Biancucci Da: Charles Mills charl...@mcn.org A: IBM-MAIN@LISTSERV.UA.EDU Inviato: Martedì 15 Gennaio 2013 18:04 Oggetto: Break a dataset into new record boundaries? I've got a dataset that has been mangled through some misguided efforts such that original record boundaries have been lost. It used to be RECFM=V and now it is RECFM=F As luck would have it, every original record begins with the same hex value. Can anyone suggest a simple tool -- z/OS, USS, or Windows -- that would reformat the records breaking on every occurrence of a particular byte value? Yes, I know I will get some false positives, but it's test data, not production data, and I can probably live with that. It would be an improvement on what I have -- that's for sure. I believe I have access to ICETOOL but I am embarrassed to admit I have never used it. I glanced at the doc just now but did not see anything that looked relevant -- but perhaps I missed something. Thanks all! Charles -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
I would do Perl too, but what if you are limited to Rexx and EXECIO Ze'ev Atlas From: Shmuel Metz (Seymour J.) shmuel+...@patriot.net To: IBM-MAIN@LISTSERV.UA.EDU Sent: Tuesday, January 15, 2013 10:44 PM Subject: Re: Break a dataset into new record boundaries? In 00b301cdf342$63a548e0$2aefdaa0$@mcn.org, on 01/15/2013 at 09:04 AM, Charles Mills charl...@mcn.org said: As luck would have it, every original record begins with the same hex value. Can anyone suggest a simple tool -- z/OS, USS, or Windows -- that would reformat the records breaking on every occurrence of a particular byte value? I'd probably write a Perl script. -- Shmuel (Seymour J.) Metz, SysProg and JOAT Atid/2 http://patriot.net/~shmuel We don't care. We don't have to care, we're Congress. (S877: The Shut up and Eat Your spam act of 2003) -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
/**/ ELABORA: DO I = 1 TO INPUT.0 LETTI = LETTI + 1 INP_STR = INP_STR || INPUT.I XY = INDEX(INP_STR,DELIM) DO WHILE(XY 0) IF OUT_STR THEN DO L = L + 1 LISTA.L = DELIM || OUT_STR OUT_STR = IF L = BLOCK_READ THEN DO BLOCCW = BLOCCW + 1 EXECIO L DISKW FILE2(STEM LISTA. SAY SCRITTO BLOCCO: BLOCCW DI L RECORDS L = 0 END END OUT_STR = OUT_STR || LEFT(INP_STR,XY-1) INP_STR = SUBSTR(INP_STR,XY+1) XY = INDEX(INP_STR,DELIM) END END RETURN Da: Charles Mills charl...@mcn.org A: IBM-MAIN@LISTSERV.UA.EDU Inviato: Mercoledì 16 Gennaio 2013 16:53 Oggetto: Re: Break a dataset into new record boundaries? Charles has already solved this? Yup. 98% anyway. Charles -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Dave Salt Sent: Wednesday, January 16, 2013 7:17 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Break a dataset into new record boundaries? As I understand it, Charles has already solved this? But if not, and if help is still required with writing a macro, let me know. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Break a dataset into new record boundaries?
I've got a dataset that has been mangled through some misguided efforts such that original record boundaries have been lost. It used to be RECFM=V and now it is RECFM=F As luck would have it, every original record begins with the same hex value. Can anyone suggest a simple tool -- z/OS, USS, or Windows -- that would reformat the records breaking on every occurrence of a particular byte value? Yes, I know I will get some false positives, but it's test data, not production data, and I can probably live with that. It would be an improvement on what I have -- that's for sure. I believe I have access to ICETOOL but I am embarrassed to admit I have never used it. I glanced at the doc just now but did not see anything that looked relevant -- but perhaps I missed something. Thanks all! Charles -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
On Tue, 15 Jan 2013 09:04:30 -0800, Charles Mills wrote: I've got a dataset that has been mangled through some misguided efforts such that original record boundaries have been lost. It used to be RECFM=V and now it is RECFM=F Surely not FTP!? As luck would have it, every original record begins with the same hex value. Can anyone suggest a simple tool -- z/OS, USS, or Windows -- that would reformat the records breaking on every occurrence of a particular byte value? I'd just write a Rexx program: read; concatenate; parse; rinse; repeat. John M. would likely use Perl. Also try tr(1) under USS. But that might introduce more false positives if your delimiter is not 0x15. -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
Is the file editable? If so, a very simple edit macro would do what you want. Contact me off-list if you need help with it. Dave Salt SimpList(tm) - try it; you'll get it! http://www.mackinney.com/products/program-development/simplist.html Date: Tue, 15 Jan 2013 09:04:30 -0800 From: charl...@mcn.org Subject: Break a dataset into new record boundaries? To: IBM-MAIN@LISTSERV.UA.EDU I've got a dataset that has been mangled through some misguided efforts such that original record boundaries have been lost. It used to be RECFM=V and now it is RECFM=F As luck would have it, every original record begins with the same hex value. Can anyone suggest a simple tool -- z/OS, USS, or Windows -- that would reformat the records breaking on every occurrence of a particular byte value? Yes, I know I will get some false positives, but it's test data, not production data, and I can probably live with that. It would be an improvement on what I have -- that's for sure. I believe I have access to ICETOOL but I am embarrassed to admit I have never used it. I glanced at the doc just now but did not see anything that looked relevant -- but perhaps I missed something. Thanks all! Charles -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
I've got a dataset that has been mangled through some misguided efforts such that original record boundaries have been lost. It used to be RECFM=V and now it is RECFM=F As luck would have it, every original record begins with the same hex value. Can anyone suggest a simple tool -- z/OS, USS, or Windows -- that would reformat the records breaking on every occurrence of a particular byte value? Is it a text file, or binary? If it contains only printable display characters, you could FTP it to windows, and they use an editor to prepend the record prefix with CRLF. Then FTP it back to z/OS. If binary, I would just write a one-off ASM program to recover the original records. It's probably a 30 minute task, easier than trying to learn anything new. John -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
I know an easy way to do it in a z/OS UNIX file, using sed. The only restriction is that it won't work if the file has an embedded x'15' (z/OS UNIX new line). On a z/OS UNIX shell prompt (such as TSO OMVS, or ssh or telnet). If the value at the start of the record is not a printable character, you must determine its OCTAL value (not HEX). Suppose the value is x'27', which is octal 047 cp -B //'ZOS.DSN' zos.dsn #copy to UNIX file in binary mode sed 's/\047/\n\047/g' zos.dsn zos.dsn.txt #insert new line before beginning of record value cp zos.dsn.txt //ZOS.DSN.VB.TXT #copy to dataset in TEXT mode If the character is printable, just use it in the sed: sed 's/*/\n*/g' zos.dsn zos.dsn.txt Now, if that special value occurs _only_ as the first character, you're golden. Otherwise you'll need to edit the new data set and perhaps do some TF commands to flow multiple records into a single record. I do this by inserting a blank record after the last of the continuations, do the TF on the first record of the set, then delete the inserted blank record. Oh, I'd preallocate the zos.dsn.vb.txt files with the proper DCB attributes before doing the above. On Tue, Jan 15, 2013 at 11:04 AM, Charles Mills charl...@mcn.org wrote: I've got a dataset that has been mangled through some misguided efforts such that original record boundaries have been lost. It used to be RECFM=V and now it is RECFM=F As luck would have it, every original record begins with the same hex value. Can anyone suggest a simple tool -- z/OS, USS, or Windows -- that would reformat the records breaking on every occurrence of a particular byte value? Yes, I know I will get some false positives, but it's test data, not production data, and I can probably live with that. It would be an improvement on what I have -- that's for sure. I believe I have access to ICETOOL but I am embarrassed to admit I have never used it. I glanced at the doc just now but did not see anything that looked relevant -- but perhaps I missed something. Thanks all! Charles -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- Maranatha! John McKown -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
On Tue, 15 Jan 2013 11:21:37 -0600, Roberts, John J wrote: If binary, I would just write a one-off ASM program to recover the original records. It's probably a 30 minute task, easier than trying to learn anything new. For me and for some others, that _is_ trying to learn something new. -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
On Tue, 15 Jan 2013 09:04:30 -0800, Charles Mills wrote: I've got a dataset that has been mangled through some misguided efforts such that original record boundaries have been lost. It used to be RECFM=V and now it is RECFM=F As luck would have it, every original record begins with the same hex value. Can anyone suggest a simple tool -- z/OS, USS, or Windows -- that would reformat the records breaking on every occurrence of a particular byte value? Having RTFM a little more, I'd go with (untested): cp -B //'BAD.DATA.SET' /dev/fd/1 | tr '\???\025' '\025\???' | cp /dev/fd/0 //'BETTER.DATA.SET' o where \??? is the _octal_ value of your delimiter character (\025 is octal newline). o Preallocate your BETTER.DATA.SET. Oops. This loses your delimiter character. Put it back with sed. -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
Wow! What an awesome group and resource. Five answers in twenty minutes. Responding more or less to everyone - I realized after I hit send what I had implied but failed to state: the file is binary -- that is, many of the characters are not printable -- basic mainframey data. I suspect that editing it under Windows would be problematic. - I have both Rexx and assembler skills. Yeah, I was thinking that if there were not another approach I might write a little Rexx program. - The sed approach looks interesting. I have very basic UNIX skills so it would be a little bit of a challenge. - What I like best I think is Dave Salt's approach. The file is only 36+K. I suspect it is a couple of hundred records at most. I could pretty easily do a FIND on the hex delimiter, do an eyeball check on whether it was a real record boundary or a false positive (I can recognize the start of a real record), and then either hit REFIND or a PF key that invoked a macro that split the record at that point. Easier to debug than the Rexx program, and no false splits to repair. I will still have to re-join the records that currently break erroneously at the FB boundaries. Whoever it was, thanks for the TF suggestion -- that should work. I confess I have never written an ISPF edit macro. (I wrote a bunch for XEDIT back when dinosaurs roamed the earth.) Dave, if you wanted to consider this contacting you you could send me whatever clues you wanted. I think you can make out my e-mail but if not it is charlesm at mcn dot org. I think I just need a PF-key-invocable macro that would split a record at the cursor position, putting the character under the cursor into the latter record. Hmmm, it's currently FB. I will have to first copy it into a VB dataset so that short records stay that way. Thanks all! Charles -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Paul Gilmartin Sent: Tuesday, January 15, 2013 9:25 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Break a dataset into new record boundaries? On Tue, 15 Jan 2013 11:21:37 -0600, Roberts, John J wrote: If binary, I would just write a one-off ASM program to recover the original records. It's probably a 30 minute task, easier than trying to learn anything new. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
Doesn't TR just do a one-for-one translation of bytes? I.e. I don't think you can use it to insert, as your OOPS indicated. Your tr translates all \??? to \025 and all \025 to \???. I don't think this is what is desired. We could merge your answer with mine similar to: cp -B //'ZOS.DSN' /dev/fd/1 |\ sed 's/\???/\n\???/g' |\ cp /dev/fd/0 //'NEW.ZOS.DSN' Oh, one thing I notice. My solution will insert a blank line at the front of the file if the first byte is the \???. And it wouldn't put in a trailing new line, but I think the cp won't mind that. Of course, I wouldn't even use cp, I'd use fromdsn and todsn from Dovetail Technologies' Data Set Pipes. On Tue, Jan 15, 2013 at 11:44 AM, Paul Gilmartin paulgboul...@aim.com wrote: snip Having RTFM a little more, I'd go with (untested): cp -B //'BAD.DATA.SET' /dev/fd/1 | tr '\???\025' '\025\???' | cp /dev/fd/0 //'BETTER.DATA.SET' o where \??? is the _octal_ value of your delimiter character (\025 is octal newline). o Preallocate your BETTER.DATA.SET. Oops. This loses your delimiter character. Put it back with sed. -- gil -- Maranatha! John McKown -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
Charles, You can use RESIZE operator to break a large record into small records. I assumed that each record starts with X'5B' ($) and each record has a max length of 200 bytes and you have a max of 10 records in a single large FB record. //STEP0100 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //IN DD * $AAA$BBB$CC$DDD //OUT DD SYSOUT=* //TOOLIN DD * RESIZE FROM(IN) TO(OUT) TOLEN(200) USING(CTL1) //* //CTL1CNTL DD * OPTION COPY INREC PARSE=(%01=(ABSPOS=2,ENDBEFR=C'$',FIXLEN=199), %02=(ENDBEFR=X'5B',FIXLEN=199), %03=(ENDBEFR=X'5B',FIXLEN=199), %04=(ENDBEFR=X'5B',FIXLEN=199), %05=(ENDBEFR=X'5B',FIXLEN=199), %06=(ENDBEFR=X'5B',FIXLEN=199), %07=(ENDBEFR=X'5B',FIXLEN=199), %08=(ENDBEFR=X'5B',FIXLEN=199), %09=(ENDBEFR=X'5B',FIXLEN=199), %10=(ENDBEFR=X'5B',FIXLEN=199)), BUILD=(X'5B',%01,X'5B',%02,X'5B',%03,X'5B',%04,X'5B',%05, X'5B',%06,X'5B',%07,X'5B',%08,X'5B',%09,X'5B',%10) OUTFIL FTOV,VLTRIM=C' ',OMIT=(2,199,CH,EQ,C' ') //* The output from this job is $AAA $BBB $CC $DDD Check this link which explains in detail about RESIZE operator. http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/7.13 If that is not what you want please show us a sample data and desired output along with DCB properties of both input and output.. Thanks, Sri Hari Kolusu DFSORT Development IBM Mainframe Discussion List IBM-MAIN@listserv.ua.edu wrote on 01/15/2013 09:04:30 AM: From: Charles Mills charl...@mcn.org To: IBM-MAIN@listserv.ua.edu, Date: 01/15/2013 09:11 AM Subject: Break a dataset into new record boundaries? Sent by: IBM Mainframe Discussion List IBM-MAIN@listserv.ua.edu I've got a dataset that has been mangled through some misguided efforts such that original record boundaries have been lost. It used to be RECFM=V and now it is RECFM=F As luck would have it, every original record begins with the same hex value. Can anyone suggest a simple tool -- z/OS, USS, or Windows -- that would reformat the records breaking on every occurrence of a particular byte value? Yes, I know I will get some false positives, but it's test data, not production data, and I can probably live with that. It would be an improvement on what I have -- that's for sure. I believe I have access to ICETOOL but I am embarrassed to admit I have never used it. I glanced at the doc just now but did not see anything that looked relevant -- but perhaps I missed something. Thanks all! Charles -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
On Tue, 15 Jan 2013 09:04:30 -0800, Charles Mills charl...@mcn.org wrote: I've got a dataset that has been mangled through some misguided efforts such that original record boundaries have been lost. It used to be RECFM=V and now it is RECFM=F You did not say how it was mangled, and that can be important. In the simplest case, if the data is good but someone mangled the DCB characteristics, then if you know the proper DCB characteristics you can do something like this and largely or completely recover things: // EXEC PGM=IEBGENER //SYSIN DD DUMMY //SYSPRINT DD SYSOUT=* //SYSUT1DD DUMMY,DCB=(RECFM=VB,LRECL=proper-lrecl) //SYSUT2DD DSN=broken-data-set-name,DISP=MOD,DCB=(RECFM=VB,LRECL=proper-lrecl,BLKSIZE=proper-blksize) This will copy nothing to the end of the data set, and in the process reset the DCB characteristics. Of course, you should try that with a copy of the data set, not the original, so you don't accidentally make things worse. -- Walt -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
Sri - Thanks! That will do it, assuming I do have ICETOOL. I will have to check. The only issue is that I don't know what the maximum number of real records per bad record is. But as I said, can live with a 90% job and then figure out how to manually repair the remaining 10%. Currently have another crisis on my plate but I may give this a try. Thanks again, Charles -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Sri h Kolusu Sent: Tuesday, January 15, 2013 10:20 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Break a dataset into new record boundaries? Charles, You can use RESIZE operator to break a large record into small records. I assumed that each record starts with X'5B' ($) and each record has a max length of 200 bytes and you have a max of 10 records in a single large FB record. //STEP0100 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //IN DD * $AAA$BBB$CC$DDD //OUT DD SYSOUT=* //TOOLIN DD * RESIZE FROM(IN) TO(OUT) TOLEN(200) USING(CTL1) //* //CTL1CNTL DD * OPTION COPY INREC PARSE=(%01=(ABSPOS=2,ENDBEFR=C'$',FIXLEN=199), %02=(ENDBEFR=X'5B',FIXLEN=199), %03=(ENDBEFR=X'5B',FIXLEN=199), %04=(ENDBEFR=X'5B',FIXLEN=199), %05=(ENDBEFR=X'5B',FIXLEN=199), %06=(ENDBEFR=X'5B',FIXLEN=199), %07=(ENDBEFR=X'5B',FIXLEN=199), %08=(ENDBEFR=X'5B',FIXLEN=199), %09=(ENDBEFR=X'5B',FIXLEN=199), %10=(ENDBEFR=X'5B',FIXLEN=199)), BUILD=(X'5B',%01,X'5B',%02,X'5B',%03,X'5B',%04,X'5B',%05, X'5B',%06,X'5B',%07,X'5B',%08,X'5B',%09,X'5B',%10) OUTFIL FTOV,VLTRIM=C' ',OMIT=(2,199,CH,EQ,C' ') //* The output from this job is $AAA $BBB $CC $DDD Check this link which explains in detail about RESIZE operator. http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/7.13 If that is not what you want please show us a sample data and desired output along with DCB properties of both input and output.. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
Charles, You can parse up to 100 bad records (%00-%99) . If you have more than 100 bad records per large record, then you may have to do another pass of data. Thanks, Sri Hari Kolusu DFSORT Development IBM Mainframe Discussion List IBM-MAIN@listserv.ua.edu wrote on 01/15/2013 10:41:28 AM: From: Charles Mills charl...@mcn.org To: IBM-MAIN@listserv.ua.edu, Date: 01/15/2013 10:42 AM Subject: Re: Break a dataset into new record boundaries? Sent by: IBM Mainframe Discussion List IBM-MAIN@listserv.ua.edu Sri - Thanks! That will do it, assuming I do have ICETOOL. I will have to check. The only issue is that I don't know what the maximum number of real records per bad record is. But as I said, can live with a 90% job and then figure out how to manually repair the remaining 10%. Currently have another crisis on my plate but I may give this a try. Thanks again, Charles -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Sri h Kolusu Sent: Tuesday, January 15, 2013 10:20 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Break a dataset into new record boundaries? Charles, You can use RESIZE operator to break a large record into small records. I assumed that each record starts with X'5B' ($) and each record has a max length of 200 bytes and you have a max of 10 records in a single large FB record. //STEP0100 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //IN DD * $AAA$BBB$CC$DDD //OUT DD SYSOUT=* //TOOLIN DD * RESIZE FROM(IN) TO(OUT) TOLEN(200) USING(CTL1) //* //CTL1CNTL DD * OPTION COPY INREC PARSE=(%01=(ABSPOS=2,ENDBEFR=C'$',FIXLEN=199), %02=(ENDBEFR=X'5B',FIXLEN=199), %03=(ENDBEFR=X'5B',FIXLEN=199), %04=(ENDBEFR=X'5B',FIXLEN=199), %05=(ENDBEFR=X'5B',FIXLEN=199), %06=(ENDBEFR=X'5B',FIXLEN=199), %07=(ENDBEFR=X'5B',FIXLEN=199), %08=(ENDBEFR=X'5B',FIXLEN=199), %09=(ENDBEFR=X'5B',FIXLEN=199), %10=(ENDBEFR=X'5B',FIXLEN=199)), BUILD=(X'5B',%01,X'5B',%02,X'5B',%03,X'5B',%04,X'5B',%05, X'5B',%06,X'5B',%07,X'5B',%08,X'5B',%09,X'5B',%10) OUTFIL FTOV,VLTRIM=C' ',OMIT=(2,199,CH,EQ,C' ') //* The output from this job is $AAA $BBB $CC $DDD Check this link which explains in detail about RESIZE operator. http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/7.13 If that is not what you want please show us a sample data and desired output along with DCB properties of both input and output.. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
That is very neat! Thanks. I need to put that in my bag of tricks. Actually, I need to really get into the DFSORT book to see all the new nifties. I'd bet that we could use it to replace a lot of our EasyTrievePlus processing. On Tue, Jan 15, 2013 at 12:19 PM, Sri h Kolusu skol...@us.ibm.com wrote: Charles, You can use RESIZE operator to break a large record into small records. I assumed that each record starts with X'5B' ($) and each record has a max length of 200 bytes and you have a max of 10 records in a single large FB record. //STEP0100 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //IN DD * $AAA$BBB$CC$DDD //OUT DD SYSOUT=* //TOOLIN DD * RESIZE FROM(IN) TO(OUT) TOLEN(200) USING(CTL1) //* //CTL1CNTL DD * OPTION COPY INREC PARSE=(%01=(ABSPOS=2,ENDBEFR=C'$',FIXLEN=199), %02=(ENDBEFR=X'5B',FIXLEN=199), %03=(ENDBEFR=X'5B',FIXLEN=199), %04=(ENDBEFR=X'5B',FIXLEN=199), %05=(ENDBEFR=X'5B',FIXLEN=199), %06=(ENDBEFR=X'5B',FIXLEN=199), %07=(ENDBEFR=X'5B',FIXLEN=199), %08=(ENDBEFR=X'5B',FIXLEN=199), %09=(ENDBEFR=X'5B',FIXLEN=199), %10=(ENDBEFR=X'5B',FIXLEN=199)), BUILD=(X'5B',%01,X'5B',%02,X'5B',%03,X'5B',%04,X'5B',%05, X'5B',%06,X'5B',%07,X'5B',%08,X'5B',%09,X'5B',%10) OUTFIL FTOV,VLTRIM=C' ',OMIT=(2,199,CH,EQ,C' ') //* The output from this job is $AAA $BBB $CC $DDD Check this link which explains in detail about RESIZE operator. http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/7.13 If that is not what you want please show us a sample data and desired output along with DCB properties of both input and output.. Thanks, Sri Hari Kolusu DFSORT Development -- Maranatha! John McKown -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
snip I think I just need a PF-key-invocable macro that would split a record at the cursor position, putting the character under the cursor into the latter record. /snip You don't need an edit macro for that one. Just edit the dataset, enter the KEYS command and set the PF key of your choice to :TS (without the quotes). The sets the pfkey to the text split line command. Now you can position the cursor on the desired spilt character and fire away. I use this particular hot key so frequently that I set permanently as PF14 in all of my edit profiles. Bill Bass United Health Care Greenville, SC This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
Cool idea but 1. It inserts a blank line between records. 2. It pads my records with blanks. I want RECFM=V records that end where they end. Charles -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Bass, Walter W Sent: Tuesday, January 15, 2013 11:51 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Break a dataset into new record boundaries? snip I think I just need a PF-key-invocable macro that would split a record at the cursor position, putting the character under the cursor into the latter record. /snip You don't need an edit macro for that one. Just edit the dataset, enter the KEYS command and set the PF key of your choice to :TS (without the quotes). The sets the pfkey to the text split line command. Now you can position the cursor on the desired spilt character and fire away. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
1. Shouldn't happen if you hit enter right away. They're just lines for you to insert text, if wanted. 2. The file has to have variable length records to negate padding. /snip - Ted MacNEIL eamacn...@yahoo.ca Twitter: @TedMacNEIL -Original Message- From: Charles Mills charl...@mcn.org Sender: IBM Mainframe Discussion List IBM-MAIN@LISTSERV.UA.EDU Date: Tue, 15 Jan 2013 12:04:14 To: IBM-MAIN@LISTSERV.UA.EDU Reply-To: IBM Mainframe Discussion List IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Break a dataset into new record boundaries? Cool idea but 1. It inserts a blank line between records. 2. It pads my records with blanks. I want RECFM=V records that end where they end. Charles -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Bass, Walter W Sent: Tuesday, January 15, 2013 11:51 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Break a dataset into new record boundaries? snip I think I just need a PF-key-invocable macro that would split a record at the cursor position, putting the character under the cursor into the latter record. /snip You don't need an edit macro for that one. Just edit the dataset, enter the KEYS command and set the PF key of your choice to :TS (without the quotes). The sets the pfkey to the text split line command. Now you can position the cursor on the desired spilt character and fire away. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
Yeah, it seems to be working. Not sure yet. I think perhaps the apparent blanks are just ISPF edit window dressing at the ends of the lines. It doesn't know about short lines. Charles -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Ted MacNEIL Sent: Tuesday, January 15, 2013 12:13 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Break a dataset into new record boundaries? 1. Shouldn't happen if you hit enter right away. They're just lines for you to insert text, if wanted. 2. The file has to have variable length records to negate padding. /snip - Ted MacNEIL eamacn...@yahoo.ca Twitter: @TedMacNEIL -Original Message- From: Charles Mills charl...@mcn.org Sender: IBM Mainframe Discussion List IBM-MAIN@LISTSERV.UA.EDU Date: Tue, 15 Jan 2013 12:04:14 To: IBM-MAIN@LISTSERV.UA.EDU Reply-To: IBM Mainframe Discussion List IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Break a dataset into new record boundaries? Cool idea but 1. It inserts a blank line between records. 2. It pads my records with blanks. I want RECFM=V records that end where they end. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
There's also this problem trying to edit the dataset but I'm up to my stack depth in alligators already. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ISPF processor ended abnormally * * * * * * * * System abend code0C4 * * * * Reason code 11* * * * * * * * * * * * * * * * Note: The ABEND and REASON codes displayed above are * * * *HEXADECIMAL values for SYSTEM abends and DECIMAL * * * *values for USER abends.* * * * * * * * Enter HELP command for list of common ABEND codes. * * * * Press ENTER key for additional DIAGNOSTIC information. * * * * Enter END command to display primary option menu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Charles -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Paul Gilmartin Sent: Tuesday, January 15, 2013 12:44 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Break a dataset into new record boundaries? On Tue, 15 Jan 2013 12:16:55 -0800, Charles Mills wrote: Yeah, it seems to be working. Not sure yet. I think perhaps the apparent blanks are just ISPF edit window dressing at the ends of the lines. It doesn't know about short lines. Of course, since you say the data are binary, a 0x40 at the end of a record (or where one was inadvertently broken) may be critical. Unfortunately, there's no way to tell ISPF not to add or remove trailing blanks. -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
Okay, I think I have it. I've spent too much time on this already. Yeah, it's imperfect. - The problem Gil describes below - TF seems confused by the binary data and at the very least stops on any line with a leading blank, I think. - Maybe one or two other details. But it's good enough for test data. I can just delete any hosed up records. The trick is defining a PF key as :TS;RFIND;RFIND That pretty well automates everything except the eyeball check is this a real record? You need two RFINDs because the first one finds the same byte again because it has now been moved down onto a lower line by TS. A little bit of a PITA: more records than I thought. Oh well. Sorry for hitting the panic button about trailing blanks. I was not familiar with the look of the ISPF editor with V records and HEX ON. It seems to me that the trailing blanks it displays are wrong: there are not blanks there; there is nothing there, which is not the same thing. Whatever. No idea why ISPF is blowing up with a S0C4. Very strange. The sequence is as follows: Edit data set -- all goes as expected. Exit out of edit. Edit data set -- ISPF immediately S0C4's. Edit data set again -- all goes as expected. Repeat as necessary. Thanks all! Charles -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Paul Gilmartin Sent: Tuesday, January 15, 2013 12:44 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Break a dataset into new record boundaries? On Tue, 15 Jan 2013 12:16:55 -0800, Charles Mills wrote: Yeah, it seems to be working. Not sure yet. I think perhaps the apparent blanks are just ISPF edit window dressing at the ends of the lines. It doesn't know about short lines. Of course, since you say the data are binary, a 0x40 at the end of a record (or where one was inadvertently broken) may be critical. Unfortunately, there's no way to tell ISPF not to add or remove trailing blanks. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
Charles: If all the records are V then why not just zap the dscb? then user iebgener? If the records are mixed (F VB) then use any of the suggestions. Ed On Jan 15, 2013, at 11:53 AM, Charles Mills wrote: Wow! What an awesome group and resource. Five answers in twenty minutes. Responding more or less to everyone - I realized after I hit send what I had implied but failed to state: the file is binary -- that is, many of the characters are not printable -- basic mainframey data. I suspect that editing it under Windows would be problematic. - I have both Rexx and assembler skills. Yeah, I was thinking that if there were not another approach I might write a little Rexx program. - The sed approach looks interesting. I have very basic UNIX skills so it would be a little bit of a challenge. - What I like best I think is Dave Salt's approach. The file is only 36+K. I suspect it is a couple of hundred records at most. I could pretty easily do a FIND on the hex delimiter, do an eyeball check on whether it was a real record boundary or a false positive (I can recognize the start of a real record), and then either hit REFIND or a PF key that invoked a macro that split the record at that point. Easier to debug than the Rexx program, and no false splits to repair. I will still have to re-join the records that currently break erroneously at the FB boundaries. Whoever it was, thanks for the TF suggestion -- that should work. I confess I have never written an ISPF edit macro. (I wrote a bunch for XEDIT back when dinosaurs roamed the earth.) Dave, if you wanted to consider this contacting you you could send me whatever clues you wanted. I think you can make out my e-mail but if not it is charlesm at mcn dot org. I think I just need a PF-key-invocable macro that would split a record at the cursor position, putting the character under the cursor into the latter record. Hmmm, it's currently FB. I will have to first copy it into a VB dataset so that short records stay that way. Thanks all! Charles -Original Message- From: IBM Mainframe Discussion List [mailto:IBM- m...@listserv.ua.edu] On Behalf Of Paul Gilmartin Sent: Tuesday, January 15, 2013 9:25 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Break a dataset into new record boundaries? On Tue, 15 Jan 2013 11:21:37 -0600, Roberts, John J wrote: If binary, I would just write a one-off ASM program to recover the original records. It's probably a 30 minute task, easier than trying to learn anything new. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Break a dataset into new record boundaries?
The records can start out F or V as one chooses. That sounds like I am messing with you, but the file starts out (already mangled) on my PC, so I can upload it to any dataset I want. Typical of binary files on other than a mainframe or AS/400, there are no system line-endings. I know where the records begin and end but FTP does not. I first uploaded it to an FB dataset but ultimately decided VB made better sense. It is only 37K so it is quick to upload. What would I zap the DSCB to? The records vary in length. The problem is the records (or lack of record boundaries) not the RECFM. Anyway, I have it done. I think I mangled 3 or 4 out of ~150 records. Good enough. 146 more test records than I had before. Charles -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Ed Gould Sent: Tuesday, January 15, 2013 4:40 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Break a dataset into new record boundaries? Charles: If all the records are V then why not just zap the dscb? then user iebgener? If the records are mixed (F VB) then use any of the suggestions. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN