Adding spaces in a REFORMAT FIELDS statement?



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

Adding spaces in a REFORMAT FIELDS statement?

Postby mberger » Thu Jun 10, 2010 6:28 pm

I am attempting to join 2 files by key, in the output I want to include elements from both files but also want to insert spaces in some areas.

For example:

File 1 contains this record:
023 123 Main Street

File 2 contains this record:
023 Joe Smith

If 023 was the key value, I am joining these two files and would want to create the following record:
023 (many spaces) Joe Smith (many spaces) 123 Main Street

The following statement would combine the data properly, but not in the format I desire.
REFORMAT FIELDS=(F2:1,13,F1:5,15)

Is there a way to add spaces or to indicate where I want each field to begin? I know in a standard sort, you can specify the output position in the OUTFIL OUTREC statement, or use the X to represent a blank (or #X for multiple blanks).
mberger
 
Posts: 9
Joined: Thu May 06, 2010 8:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Adding spaces in a REFORMAT FIELDS statement?

 

Re: Adding spaces in a REFORMAT FIELDS statement?

Postby Alissa Margulies » Thu Jun 10, 2010 7:48 pm

Additional characters cannot be introduced within the REFORMAT statement. Therefore, you can add an OUTREC or OUTFIL OUTREC statement to the JOIN application. For example:
//SYSIN DD *
  .
  .
  .
  REFORMAT FIELDS=(F2:1,13,F1:5,15)
  SORT FIELDS=COPY
  OUTREC BUILD=(1,3,10X,4,10,10X,14,15)
/*
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: Adding spaces in a REFORMAT FIELDS statement?

Postby masterchecho » Wed Mar 28, 2012 11:07 pm

Hi ,

It is possible to add the value of a parameter in the outrec build instead of spaces or Zeroes ... ?

In the previous example

//SYSIN DD *
.
.
.
REFORMAT FIELDS=(F2:1,13,F1:5,15)
SORT FIELDS=COPY
OUTREC BUILD=(1,3,10X,4,10,10X,14,15) ==> here is where i need to add a parameter instead of spaces or zeroes...

OUTREC BUILD=(1,3,&VAriable1,4,10,10X,14,15) ==> where variable1 is a parameter which contains a date , I dont need a system date which is supported by outrec, instead this parameter contains a date in YYMMDD
/*

Thanks a lot
Sergio
masterchecho
 
Posts: 10
Joined: Tue May 25, 2010 1:49 am
Has thanked: 0 time
Been thanked: 0 time

Re: Adding spaces in a REFORMAT FIELDS statement?

Postby BillyBoyo » Wed Mar 28, 2012 11:23 pm

Please next time start a new topic for a new question. You can always refer to the original if useful to what you are saying.

Yes. I suggest you look at Symbols/SYMNAMES in your documentation. Where is the date coming from?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Adding spaces in a REFORMAT FIELDS statement?

Postby masterchecho » Thu Mar 29, 2012 12:04 am

BillyBoyo wrote:Please next time start a new topic for a new question. You can always refer to the original if useful to what you are saying.

Yes. I suggest you look at Symbols/SYMNAMES in your documentation. Where is the date coming from?



OK, next time i will open a new topic.

Regarding the date, the date is coming from the jcl as a parameter and it is passed to the proc, and inside this proc the date is used to "build" dataset names...



This is my code :

JOINKEYS FILE=F1,FIELDS=(1,4,BI,A),SORTED
JOINKEYS FILE=F2,FIELDS=(1,4,BI,A),SORTED
JOIN UNPAIRED,F2,ONLY
REFORMAT FIELDS=(F2:1,100)
SORT FIELDS=COPY
OUTREC BUILD=(1,15,S'&PKZDATE',75X)

But is nor working, is not resolving &PKZDATE and is giving me an error in the "S"

I've checked what you mentioned about the Symbols, and it seems that i have to create a pds member wich contains the parameter because the parameter is not a system symbol...

Regards
Sergio
masterchecho
 
Posts: 10
Joined: Tue May 25, 2010 1:49 am
Has thanked: 0 time
Been thanked: 0 time

Re: Adding spaces in a REFORMAT FIELDS statement?

Postby BillyBoyo » Thu Mar 29, 2012 12:23 am

What version of Synsort are you on? If not "current", I don't think that you can directly access the parameter/set from JCL.

You'd then need to find "something else" which can take the parameter and write it to a dataset. From that you can generate a Symbol/SYMNAME with that value, and use that in your sort.

If you are current, it will be in your documentation for Syncsort how take the parameter/set value.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Adding spaces in a REFORMAT FIELDS statement?

Postby masterchecho » Thu Mar 29, 2012 6:24 pm

Is not current, so i've created a rexx which create a member in a pds , and this member contains the sort card with the parameters resolved.


Thanks a lot for your help
Sergio
masterchecho
 
Posts: 10
Joined: Tue May 25, 2010 1:49 am
Has thanked: 0 time
Been thanked: 0 time

Re: Adding spaces in a REFORMAT FIELDS statement?

Postby BillyBoyo » Thu Mar 29, 2012 6:55 pm

Thanks for letting us know.

Raise the paperwork to simplify it when/if you get the later release of Syncsort.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Adding spaces in a REFORMAT FIELDS statement?

Postby BillyBoyo » Fri Mar 30, 2012 4:50 am

Apologies to any readers of this thread. I can find nothing to support my wild idea that the current release of Syncsort supports the supply of parameters from the JCL into the sort control cards. :oops:
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post