Adding char last in VB file



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Adding char last in VB file

Postby LasseH » Mon Nov 08, 2010 2:57 pm

Copying a z/OS file to a DataShr (USS)
Need to append a CRLF at the end of each record. (so Windows can read the file record by record)
Can't use OVERLAY cause that will expand all the records to maximum
//Lasse
LasseH
 
Posts: 50
Joined: Mon Nov 08, 2010 2:51 pm
Has thanked: 3 times
Been thanked: 1 time

Re: Adding char last in VB file

 

Re: Adding char last in VB file

Postby Frank Yaeger » Tue Nov 09, 2010 12:25 am

There is no built-in function for that.

You could write your own E15 or E35 exit to do it.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Adding char last in VB file

Postby steve-myers » Tue Nov 09, 2010 12:43 am

I'm not sure I understand the requirement. If the file is a text file and sent to your PC using FTP or the 3270 file transfer method, the CR LF characters will be added by the FTP client (to replace the LF character inserted by the mainframe FTP server) or IND$FILE (the mainframe TSO command that implements the 3270 file transfer method) by specifying the CRLF parameter when you start the process at your PC.
steve-myers
Global moderator
 
Posts: 1886
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: Adding char last in VB file

Postby Robert Sample » Tue Nov 09, 2010 12:55 am

Use FTP option SBSENDEOL CRLF as long as you're sending text data.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 222 times

Re: Adding char last in VB file

Postby LasseH » Mon Nov 15, 2010 8:14 pm

Thanks

I'll go for the E35 exit.

One question:
What is the "outputarea" for?
"leaving" is input
"return" is updated
"output" is ?

One problem:
If I'm sorting to SORTOUT (recfm=VB) allocated as uss-file, i'll receive an S614 abend

IEC204I 0000000B,K39828J7,SORT1 ,SORTOUT -000,DOWRITE ,0004,00000001
IEC214I 614-10,IGG0201W,K39828J7,SORT1,SORTOUT

ICE055I 0 INSERT 0, DELETE 0
ICE054I 0 RECORDS - IN: 13, OUT: 13
ICE185A 0 AN S614 ABEND WAS ISSUED BY DFSORT

The same with a recfm=FB file it works ok
LasseH
 
Posts: 50
Joined: Mon Nov 08, 2010 2:51 pm
Has thanked: 3 times
Been thanked: 1 time

Re: Adding char last in VB file

Postby steve-myers » Tue Nov 16, 2010 7:09 am

I don't think I've ever encountered a 614 ABEND before. I went to the book. The explanation there, coupled with the contents of the message, confused me. If I read it right, your JCL is something like this -
//SORTOUT  DD  --- your data set ---
//         DD  --- another data set ---
I hate to tell you this, but you can't do that!
steve-myers
Global moderator
 
Posts: 1886
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: Adding char last in VB file

Postby LasseH » Tue Nov 16, 2010 1:50 pm

Here's the Reuslt, JCL and "procedure division" from exit35

JCL:

// SET USS='/users/dfs/data/DW/LASSEINB.txt'
//*
//*--------------------------------------------------------
//* STEPNAME: SORT
//* STEPINFO: SORT
//*--------------------------------------------------------
//SORT EXEC PGM=SORT
//* dcb=ps vb 717
//SORTIN DD DISP=SHR,DSN=INBP.INBP110M.UTFIL.S030.G0018V00
//EXITLIB DD DISP=SHR,DSN=GKFP.GEM.EXECLIB
//* ZFS
//SORTOUT DD PATH='&USS',
// PATHDISP=(KEEP,DELETE),
// PATHOPTS=(OWRONLY,OCREAT),
// PATHMODE=(SIRWXU,SIRWXG,SIROTH),
// FILEDATA=TEXT,
//* lrecl=713 + 4 for rdw + 1 for crlf
// LRECL=718,RECFM=VB
//SYSOUT DD SYSOUT=*
//DFSPARM DD *
OPTION COPY
MODS E35=(DSEXIT35,6100,EXITLIB,C)
END
//*


EXIT35:

if l01-endrec
set e35-donotreturn to true
else
move leaving-reclen to return-reclen
add +1 to return-reclen
move l02-leavingrec to l03-returnrec
move crlf to l03-record(return-reclen)
set e35-alter-repl-record to true
end-if

move sorte35-rc to return-code
goback

RESULT:
ALP100I JOBNAME STEPNAME PROCSTEP RC EXCP CONN TCB
ALP100I K39828J6 DELETE 00 38 2 .00
+IEC020I 001-3,K39828J6,SORT ,SORTOUT ,SMS
+IEC020I NO SYNAD EXIT SPECIFIED
IEA995I SYMPTOM DUMP OUTPUT 878
SYSTEM COMPLETION CODE=001
TIME=16.34.45 SEQ=20016 CPU=0000 ASID=0093
PSW AT TIME OF ERROR 078D1400 80E2FA1C ILC 2 INTC 0D
NO ACTIVE MODULE FOUND
NAME=UNKNOWN
DATA AT PSW 00E2FA16 - 00181610 0A0D1851 A7C80048
AR/GR 0: 8F9EAC66/80000000 1: 00000000/80001000
2: 00000000/00008DA8 3: 00000000/0000A6F8
4: 00000000/0000A630 5: 00000000/0005F870
6: 00000000/00FD86B8 7: 00000000/00155198
8: 00000000/00008D60 9: 00000000/07D2CD78
A: 00000000/009CAFE8 B: 00000000/80E2F65E
C: 00000000/0005F870 D: 00000000/00006608
E: 00000000/00FB4008 F: 00000000/00000000
END OF SYMPTOM DUMP
+CEE0374C CONDITION=CEE3250C TOKEN=00040CB2 61C3C5C5 00000000
WHILE RUNNING PROGRAM ICETRYB
AT THE TIME OF INTERRUPT
PSW 078D0400 00CABCA2
GPR 0-3 00000300 80001000 00008DA8 0000A6F8
GPR 4-7 0000A630 0005F870 00FD86B8 00155198
GPR 8-B 00008D60 07D2CD78 009CAFE8 80E2F65E
GPR C-F 0005F870 00006608 00FB4008 00000000
FLT 0-2 2610000000000000 1800000000000000
FLT 4-6 0000000000000000 0000000000000000
IEC204I 0000000B,K39828J6,SORT ,SORTOUT -000,DOWRITE ,0004
IEC214I 614-10,IGG0201W,K39828J6,SORT,SORTOUT
IEC999I IFG0TC0A,IFG0TC0B,K39828J6,SORT ,DEB ADDR=9D7CC8
CC
IEF450I K39828J6 SORT - ABEND=S001 U0000 REASON=00000000 883
TIME=16.34.45
LasseH
 
Posts: 50
Joined: Mon Nov 08, 2010 2:51 pm
Has thanked: 3 times
Been thanked: 1 time

Re: Adding char last in VB file

Postby stevexff » Tue Nov 16, 2010 4:13 pm

The error is on the CLOSE of the UNIX HFS file. According to the messages:

IEC204 x'0B' An unexpected error returned from a UNIX System Services service. There is an fc and rc returned in the message but it doesn't indicate where you should look these up (tsk, tsk, IBM...).

IEC214 x'10' A spooled or subsystem data set could not be closed by a job entry subsystem or alternate subsystem. The failing DCB could not be closed; processing for other DCBs closed in parallel continues normally.
Check your permissions maybe? Try it without the E35 to take your code out of the equation, once you've got it copying the file successfully without the CRLF then add the MODS statement.

Also, the last time I looked CRLF was two bytes, not one - end-of-line is CRLF on Windows, LF on Unix and later Macs, and CR on pre OSX Macs...
Steve
stevexff
 
Posts: 56
Joined: Wed Nov 10, 2010 7:48 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Adding char last in VB file

Postby harisukumaran » Wed Dec 14, 2011 7:30 pm

Is there any way to add a character at the end of a vb record under the new version of dfsort ?
harisukumaran
 
Posts: 5
Joined: Wed Dec 14, 2011 7:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Adding char last in VB file

Postby BillyBoyo » Wed Dec 14, 2011 7:52 pm

Please don't put a new question under an old topic.

It depends on exactly what you want to do (this is the answer bit now).

If you can describe it more exactly, like do you only want to do it to one record? One record type? All records? What?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post