Reformat OutPut File



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Reformat OutPut File

Postby rayngerfan » Fri Apr 19, 2013 11:30 pm

Hi

I have two files FB,LRECL=80. File 1 has data starting in COL 1 – 18 & file 2 has data starting in col 37 – 65. Both file contain 80 records. I would like to copy the records from file 1 as is and overlay the records in file 2 starting in col 20. I tried using the REFOMAT paramter but I can't get the records from file 2 to be rewitten in col 20 with the data from file 1. I was thinking that this might be possible with the overlay parameter? Any help is greatly appreciated.

I/P FILE1 (80 RRECORDS cols 1-18)

NAXXXXXX HAABWIL I
NAXXXXXX BATOSHO A

I/P FILE2 (80 RECORDS COLS 37 – 70)

                                                  Able WILSON
                                                  Thomas Shoe   


O/P FILE

NAXXXXXX HAABWIL I Able WILSON
NAXXXXXX BATOSHO A Thomas Shoe


Code'd
rayngerfan
 
Posts: 51
Joined: Fri Apr 17, 2009 4:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Reformat OutPut File

Postby MrSpock » Sat Apr 20, 2013 2:40 am

Sounds to me like a good case for using JOINKEYS. Make one pass of each of the files to add sequence numbers to each so you have a key to join. Use JOINKEYS, and just reformat the resulting output.
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Reformat OutPut File

Postby BillyBoyo » Sat Apr 20, 2013 3:58 am

Yes, JOINKEYS. However, is your SyncSort the latest, which does support JNFnCNTL files, needed to do the sequence number in one step? If not, you'll need to add the sequence numbers in two separate steps, then do the JOINKEYS and doing your data-arranging with REFORMAT (which only works with JOINKEYS).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Reformat OutPut File

Postby rayngerfan » Sat Apr 20, 2013 10:34 pm

I was able to add squence numbers as Suggested and then use the JOINKEY parameter. Is it possible when reformation to get the 2nd file data to start in col 20?

//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(81,4,A)
JOINKEYS FILES=F2,FIELDS=(81,4,A)
REFORMAT FIELDS=(F1:1,18,F2:20,37)
SORT FIELDS=COPY

O/P/F                                              2nd file
1                            18               37                             80
NASUBMIT HAABWIL I                 ABLE WILSON
NASUBMIT BATOSHO A                THOMAS SHOE
rayngerfan
 
Posts: 51
Joined: Fri Apr 17, 2009 4:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Reformat OutPut File

Postby BillyBoyo » Sat Apr 20, 2013 11:49 pm

No, the REFORMAT can only include data from the JOINKEYS files.

You can instead:

  INREC BUILD=(1,18,2X,19,37)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Reformat OutPut File

Postby rayngerfan » Sun Apr 21, 2013 2:30 am

Hi BillyBoyo

I was able to get the results using this card.

INREC BUILD=(1,18,19:35,15)

I appreciate your time & help.
rayngerfan
 
Posts: 51
Joined: Fri Apr 17, 2009 4:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Reformat OutPut File

Postby BillyBoyo » Sun Apr 21, 2013 4:05 am

OK. On your REFORMAT it is best to have only the data you need. If you don't need 37 bytes of file 2, but only 15 instead, put 19,15 on the REFORMAT.

Using the column on the BUILD will work, it will pad two spaces in between the data file file 1 and the start of the data from file 2.

The difference between that and specifying the two spaces (2X) comes when you need to change something. In your case it doesn't matter, but if you had more than one field after your column number, each with their own column number, then they'd all have to change if, for instance, the length of the file 1 data has to change for some reason. So, for me, the 2X is easier to maintain.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post