|
View previous topic :: View next topic
|
| Author |
Message |
Sysaron
New User

Joined: 28 Sep 2005 Posts: 55 Location: USA
|
|
|
|
I am trying to create a SYMNAMES file for a following step and it seems that this type of file needs a different line for each symbolic character.
I want my output to look like this. But I cannot figure out how to get the 2nd line written.
Is there anyone that could advise me? I have already been thru the DFSORT manual both online and paper form.
The SORTIN looks like this
| Code: |
****** ***************************** Top of Data ***********
=COLS> ----+----1----+----2----+----3----+----4----+----5---
000001 HOX A
000002 |
My SortCards look like this
| Code: |
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(8,3,CH,EQ,C'3RD'), <-- 1ST RCD
OVERLAY=(1:C' JP1,''201''',11:33C' '),HIT=NEXT),
IFTHEN=(WHEN=(8,3,CH,EQ,C'HOX'),
OVERLAY=(1:C' JP1,''203''',11:33C' '),HIT=NEXT),
IFTHEN=(WHEN=(42,1,CH,EQ,C'A'), <-- 2ND RCD not writing
OVERLAY=(1:C' JP2,''A''',11:33C' '),HIT=NEXT),
IFTHEN=(WHEN=(42,1,CH,EQ,C'C'),
OVERLAY=(1:C' JP2,''C''',11:33C' '))
OUTFIL ENDREC=2 |
I want the output to look like this, but cant write the 2nd record:
| Code: |
****** ***************************** Top of Data *
000001 JP1,'203'
000002 JP2,'B'
****** **************************** Bottom of Data |
Thank you for any help you can give. |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
| You might want to use the OUTFIL with the '/' operator to write multiple lines. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Don't try to call your symbols JP1 and JP2, as those are in-built symbols with special meaning (to allow for up to 10 values from a PARM statement to DFSORT).
The SYMNAMES data set must contain fixed-length records of 80 bytes.
To generate two outputs from one input, you need to do as Arun has suggested, and use the slash operator, which is only present in BUILD in OUTFIL.
| Code: |
BUILD=(1,80,/,81,80) |
That would output two records, from one 160-byte record.
Since you have data on the current record you want to test, you could OVERLAY the first output at 81:, the second output at 161: (with 240:X to pad with blanks) and then BUILD with 81,80,/,161,80. |
|
| Back to top |
|
 |
Sysaron
New User

Joined: 28 Sep 2005 Posts: 55 Location: USA
|
|
|
|
Thanks, but I have been searching the IBM Knowledge Center for almost 4 hours now looking for similar examples to what you have explained. I am a DFSORT newbie. Can you please point me to somewhere , that can point me to somewhere else, where I can try to find something similar to what I am trying to do please?
Thank you for your help. |
|
| Back to top |
|
 |
Sysaron
New User

Joined: 28 Sep 2005 Posts: 55 Location: USA
|
|
|
|
I tried this, but the output file is only 40 bytes, not 80 and the 2nd line still wont write.
| Code: |
SORT FIELDS=COPY
OUTFIL FILES=1,BUILD=(1,40,/,41,40),ENDREC=1
INREC IFTHEN=(WHEN=(8,3,CH,EQ,C'3RD'), <-- 1ST RCD
BUILD=(1:C' SS1,''201''',11:33C' '),HIT=NEXT),
IFTHEN=(WHEN=(8,3,CH,EQ,C'HOX'),
BUILD=(1:C' SS1,''203''',11:33C' '),HIT=NEXT),
IFTHEN=(WHEN=(42,1,CH,EQ,C'A'), <-- 2ND RCD NOT WRITING
OVERLAY=(1:C' SS2,''A''',11:33C' '),HIT=NEXT),
IFTHEN=(WHEN=(42,1,CH,EQ,C'C'),
OVERLAY=(1:C' SS2,''C''',11:33C' ')) |
|
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
| Bill Woodger wrote: |
The SYMNAMES data set must contain fixed-length records of 80 bytes
|
Sysaron - I think you missed this line in Bill's post above. If you intend to create a SYMNAMES data set, you would have to follow the rules.
You are not modifying your second symbol value, so you do not need any 'HIT=NEXT's. You might want to do something like this.
| Code: |
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(8,3,CH,EQ,C'3RD'),
OVERLAY=(8:C'201')),
IFTHEN=(WHEN=(8,3,CH,EQ,C'HOX'),
OVERLAY=(8:C'203'))
OUTFIL BUILD=(C'SS1,''',08,3,C'''',80:X,/,
C'SS2,''',42,1,C'''') |
SORTOUT:
|
|
| Back to top |
|
 |
Sysaron
New User

Joined: 28 Sep 2005 Posts: 55 Location: USA
|
|
|
|
Thank You Arun Raj!! I Really Appreciate this Help
I knew the SYMNAMES needed to be 80 bytes, but I had No Clue how to accomplish that, based on the IBM manuals and examples that I was looking at. Everything I tried failed the test. Thank You Again So Much!
~Sysaron |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|