Copy/relocate data from VB to FB dataset



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

Copy/relocate data from VB to FB dataset

Postby danny_ce16 » Tue May 10, 2016 3:08 pm

I have a input VB file A with LRECL 573 and i need to generate a output FB file with LRECL 568. Both the files will look like below.

Input File A (in Hex format)

     A2        
10000CF400020100
4000C12000C5460C
 


I need to copy the data present in 11h position, 6 chars to File B, 13 to 18th position as below. 0 to 12 and 19 till end will be initialized by us and it wont change.

Output File B (in Hex format)

                             
000000000000020100
000C0000C000C5460C
 


We tired various methods (like one below) to copy but none seem to work as expected.


SORT FIELDS=COPY
OUTFIL FNAMES=FILEB,VTOF,OUTREC=(13:11,6,HEX,544X)
 


Kindly help us with this issue.

Re-titled
danny_ce16
 
Posts: 15
Joined: Mon Oct 24, 2011 6:14 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Need help with sortcard

Postby BillyBoyo » Tue May 10, 2016 10:06 pm

It is not clear what you expect for output. The above would give you 12 blanks, 12 bytes of hexadecimal representation of the six bytes from position 11, and then 544 blanks. Is that anywhere close to what you want.

You need to show expected output for given input, and output you are receiving for given control cards. If you want all those blanks, just ditch the HEX bit and check your counting and you should be there.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Need help with sortcard

Postby danny_ce16 » Wed May 11, 2016 3:43 pm

Sorry for the ambiguity.

this input file would be spaces from position 14 till end of length (573)
    A2        
10000CF400020100444444444444 *TILL-LRECL-END*
4000C12000C5460C000000000000 *TILL-LRECL-END*


and output file would be low values from position 17 till end of length (568)

0000000000000201000000000000 *TILL-LRECL-END*
000C0000C000C5460C0000000000 *TILL-LRECL-END*
danny_ce16
 
Posts: 15
Joined: Mon Oct 24, 2011 6:14 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Need help with sortcard

Postby enrico-sorichetti » Wed May 11, 2016 4:58 pm

when You post use a meaningful title
most of the people replying avoid as a plague the stupid titles

If You cannot describe Your requirements/ issues in 5/10 words than You have bigger problems
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Need help with sortcard

Postby danny_ce16 » Wed May 11, 2016 5:12 pm

I need help with sortcard, to copy data (0C250416000C) from certain position (11,6) of VB file to a FB file (13,6). Rest of the data in output file will be constant and initialized by us, so no change in them. did i make it sound simple now? i tried hard to describe it in 5/10 words though.
danny_ce16
 
Posts: 15
Joined: Mon Oct 24, 2011 6:14 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Need help with sortcard

Postby Terry Heinze » Wed May 11, 2016 9:21 pm

Maybe a better title would have been "Copy/relocate data from VB to FB dataset".
.... Terry
Terry Heinze
 
Posts: 239
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 12 times
Been thanked: 11 times

Re: Need help with sortcard

Postby Aki88 » Thu May 12, 2016 11:37 pm

Hello,

danny_ce16 wrote:I need help with sortcard, to copy data (0C250416000C) from certain position (11,6) of VB file to a FB file (13,6). Rest of the data in output file will be constant and initialized by us, so no change in them. did i make it sound simple now? i tried hard to describe it in 5/10 words though.


If I've understood it right, see if the below code helps:


 OPTION COPY                                    
 OUTFIL VTOF,BUILD=(12X,15,6)         <--  Tweak SORT card here to add additional positions depending on your wish.
 



Input data with HEX ON; please note, I've used a random VB file as input, but with your input data at 11th position for 6 bytes, as the remaining positions are irrelevant (as stated in your post):

----+----1----+----2----+----3----+----4----+-
1604300304      000000---À/--- /À-- --ÀÁ ÂÂ/-Â
FFFFFFFFFF020100FFFFFF666666662666626666266666
1604300304C5460C00000000041000D1400D0045D22102


The output comes as:


Required data in 13th position -
                 
----+----1----+---
                 
444444444444020100
000000000000C5460C
 


Hope this helped.
Aki88
 
Posts: 381
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 36 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post