Adding char last in VB file



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

Re: Adding char last in VB file

Postby harisukumaran » Wed Dec 14, 2011 11:14 pm

I have a variable length file that I need to send to a unix box. File is in UTF8 format and so I need to send it with translation to a unix box. I would like to append each record with x'0a before transferring the file
harisukumaran
 
Posts: 5
Joined: Wed Dec 14, 2011 7:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Re: Adding char last in VB file

 

Re: Adding char last in VB file

Postby steve-myers » Wed Dec 14, 2011 11:25 pm

This is a new question; it should be opened in a new topic.

If the dataset is sent as a text file using FTP, FTP will automatically insert a new line character, which I presume is what X'0A' is, at the end of each logical record.
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 harisukumaran » Thu Dec 15, 2011 7:02 pm

I want to attach x'0a to the end of all records
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 » Thu Dec 15, 2011 7:17 pm

Can you please describe your actual problem, not what you think is the solution.

If you put X'0A' at the end of each record and then ftp the data, how the last byte will arrive depends on the options you supply to the ftp program. X'0A' is Line Feed in ASCII.

I suspect that lots of files are transferred daily in similar scenarios to yours without having to "have a byte added" before being presented to ftp.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Adding char last in VB file

Postby harisukumaran » Fri Dec 16, 2011 7:27 pm

I receive a multi code page ebcdic file from a remote system
The file a split based on code page
Each piece is converted to UTF8 using iconv
Pieces of the converted file are concatenated to whole
File needs to be transferred to downstream unix box via sftp
File would need to be transferred in binary as no translation should happen during transmission
Downstream system is expecting end of line marker at the end of each line

UTF8 converted file would be variable length. Iconv doesn't add end of line marker automatically neither is there any option to make it add the marker.

Does DFSORT have a way to add a character at the end of each variable length record? Or should I just do this using rexx ?
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 skolusu » Fri Dec 16, 2011 10:51 pm

harisukumaran wrote:Does DFSORT have a way to add a character at the end of each variable length record? Or should I just do this using rexx ?


Assuming that you don't have any embedded spaces and file lrecl=80 , you can use the following the following DFSORT JCL which will give you the desired results
//STEP0100 EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD DSN=Your input vb file,DISP=SHR       
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                     
  SORT FIELDS=COPY                                   
  INREC BUILD=(1,80,JFY=(SHIFT=LEFT,TRAIL=X'0A'))   
//*   


If you do have embedded spaces in between and you want to retain them you can code an E15 exit in cobol, assembler and plug it in to DFSORT.
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

Previous

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post