Joined: 13 Feb 2010 Posts: 4 Location: Cleveland, OH
First post from me. I'm using SYNCSORT FOR Z/OS 1.3.0.3R
Input description FB, LRECL=39
File is an unload from a DB2 table
First two bytes of the input file are binary
Positions 3 through 28 of the file are character
Positions 29 - 38 Date(4)
Position 39 is a null indicator added by BMC. Null is indicated by "?"
For records with a "#" in position 6, I need to do the following:
1) remove the "#" in position 6
2) remove the value "01" in positions 24 - 25
3) right justify the remaining digits, left pad with zeroes
Records with anything other than "#" in position 6 should not be modified
The data needs to be sorted in the following sequence:
MERGE FIELDS=(1,2,BI,A,3,3,CH,A,6,20,CH,A)
If possible, please provide an example with zeroes suppressed and one without
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello and welcome to the forum,
Please note that your topic has been relocated. Syncsort topics are part of "JCL". Only DFSORT questions are to be posted in the DFSORT part of the forum because we are fortunate enough to have the IBM developers support DFSORT and we have Syncsort support in the JCL part of the forum
Also, suggest you practice a bit with the "Code" tag which will preserve alignment and improve readability for things like data, jcl, code, etc. Your data has been "Code'd".
You will also want to become familiar/comfortable with the forum SEARCH (above in the blue bar). If you search the JCL part of the forum you should find multiple IFTHEN OVERLAY examples which should do what you are looking for.
Joined: 13 Feb 2010 Posts: 4 Location: Cleveland, OH
Thanks for the information. I don't have a lot of time to browse this forum while at work, but based on what I have found so far, I can use INCLUDE COND= to located records with "#" in position 6. The part I can't get to work is the right shifting and the use of existing data in the file instead of a hard coded value.
I'd love a complete answer including the Syncsort statements.
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
If you post what you have so far and show some sample input (that has run thru your code) and both the undesired output from that sample input you get as well as the output you do want, someone should be able to help.
Joined: 13 Feb 2010 Posts: 4 Location: Cleveland, OH
Please see my original post. It clearly indicates my input and desired results. I'm using MERGE FIELDS because the data is being sorted in my ORDER BY clause in my unload in the previous step of the job.
I downloaded the Syncsort manuals and have started reading through them, but I am not sure how to concatenate the control statements to get the desired results. I have thought about using a combination of OVERLAY, BUILD and SQUEEZE statements, but I am confused as to how code these in a concatenated manner.
What I have so far:
Code:
MERGE FIELDS=(1,2,BI,A,3,3,CH,A,6,20,CH,A)
INCLUDE COND=(6,1,CH,EQ,C'#')
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
Have you tried the optional IFTHEN parameter?
SyncSort for z/OS 1.3 Programmer’s Guide wrote:
The IFTHEN parameter employs conditional logic, which enables you to reformat your records based on specified criteria. Multiple IFTHEN parameters may be specified within the same control statement and are processed sequentially.