Add to a variable length record



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

Add to a variable length record

Postby Kevin Jenkins » Tue Jul 24, 2012 1:52 am

Please can you advise, if it Is possible using DFSORT to add a x'0d0a' sequence at the end of each record in a variable blocked file. The input file is ...

Organization . . . : PS
Record format . . . : VB
Record length . . . : 1500

Input records do contain embedded blanks.

Sort maint level is ...
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1

Grateful, if you can post an example if this can be done.

Regards, Kevin
Kevin Jenkins
 
Posts: 16
Joined: Fri Dec 04, 2009 4:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Add to a variable length record

 

Re: Add to a variable length record

Postby BillyBoyo » Tue Jul 24, 2012 4:32 am

If this is for shipping data off the mainframe, the software you use for that can probably do it.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Add to a variable length record

Postby skolusu » Tue Jul 24, 2012 5:17 am

Kevin Jenkins,

Currently DFSORT does not have any feature to append a character at the end of variable data. You want to append X'0D0A' which is CRLF which is only required by the windows OS. Unix just needs LF. If you are FTP'ing the data then as bill mentioned , then FTP/NDM software can insert the x'0D0A'. If you want to get it done via DFSORT then you can code a bunch of IFTHEN statements and validate the length in RDW and overlay the contents. But coding 1496 IFTHEN statements is tedious job. So I generated them. Use the following DFSORT JCL which will give you the desired results.
//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD *                                                   
Dummy record                                                           
//SORTOUT  DD DSN=&&C,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)         
//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                               
  OUTFIL REPEAT=1497,IFOUTLEN=80,IFTHEN=(WHEN=INIT,               
  BUILD=(3:C'INREC IFTHEN=(WHEN=(1,2,BI,EQ,',SEQNUM,4,ZD,START=5,
           C'),OVERLAY=(',SEQNUM,4,ZD,START=6,                   
           C':X''',C'0D0A''',C')),',81:SEQNUM,4,ZD)),             
  IFTHEN=(WHEN=(81,4,ZD,GT,1),OVERLAY=(1:8X),HIT=NEXT),           
  IFTHEN=(WHEN=(81,4,ZD,EQ,1495),OVERLAY=(48:C'1499')),           
  IFTHEN=(WHEN=(81,4,ZD,EQ,1496),OVERLAY=(48:C'1499',62:X)),     
  IFTHEN=(WHEN=(81,4,ZD,EQ,1497),BUILD=(3:C'OPTION COPY'))       
//*               
//STEP0200 EXEC PGM=SORT         
//SYSOUT   DD SYSOUT=*           
//SORTIN   DD DSN=Your Input VB 1500 byte file,DISP=SHR 
//SORTOUT  DD SYSOUT=*           
//SYSIN    DD DSN=&&C,DISP=SHR   
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Add to a variable length record

Postby Kevin Jenkins » Tue Jul 24, 2012 2:33 pm

Kolusu, Bill

Thanks to you both for your feedback. I'll explore your suggestion.

Regards, Kevin
Kevin Jenkins
 
Posts: 16
Joined: Fri Dec 04, 2009 4:46 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post