|
View previous topic :: View next topic
|
| Author |
Message |
srini1528 Currently Banned New User
.jpg)
Joined: 25 Apr 2007 Posts: 13 Location: INDIA
|
|
|
|
Hi All,
While trying to Sort my input based on the below condition I encounter a User Abend Code of 0016. Please help me resolve.
Sort Condition:
OUTFIL IFTHEN=(WHEN=(126,25,CH,EQ,C''),
BUILD=(821:126,56,A)),
IFTHEN=(WHEN=(126,25,CH,NE,C''),
BUILD=(821:70,56,A)),
IFTHEN=(WHEN=(NONE,OVERLAY=(821:C'NONE'))
The Error message is as below:
OUTFIL IFTHEN=(WHEN=(126,25,CH,EQ,C''),
*
BUILD=(821:126,56,A)),
IFTHEN=(WHEN=(126,25,CH,NE,C''),
BUILD=(821:70,56,A)),
IFTHEN=(WHEN=(NONE,OVERLAY=(821:C'NONE'))
WER901I **WARNING** SYNCSORT 1.1 TPF2B WILL EXPIRE IN 57 DAYS
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
Regards,
Srini |
|
| Back to top |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
| Check the Syncsort manual, 1.1 is old and the syntax error is pointing to the IFTHEN which is a DFSort command. |
|
| Back to top |
|
 |
srini1528 Currently Banned New User
.jpg)
Joined: 25 Apr 2007 Posts: 13 Location: INDIA
|
|
|
|
Hi,
Is it possible that we run If Then in sort to satisy certain conditions. Please give a detailed description if it can be done and also mention the utility.
Thanks |
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
| srini1528 wrote: |
Hi,
Is it possible that we run If Then in sort to satisy certain conditions. Please give a detailed description if it can be done and also mention the utility.
Thanks |
Hi srini1528,
Yeah, it's possible to use ifthen in SORT, it's available with both DFSORT &
SYNCSORT.
If you provide your input & the desired output, we can provide you good suggestions, still for a small background read on.
Following JCL can be used to sort the data-records without removing the header & trailer records.
| Code: |
//JOBCARD
//*
//STEP050 EXEC PGM=SORT,REGION=4096K
//*
//SORTIN DD DSN=HLQ.HDR.TLR.FILE,
// DISP=SHR
//SORTOUT DD DSN=HLQ.HDR.TLR.FILE.OUT,
// DISP=(NEW,CATLG,CATLG),
// DSORG=PS,
// RECFM=FB,
// LRECL=80,
// DATACLAS=LARGE,
// UNIT=SYSDA
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(20,5))
//SYSIN DD *
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'1')),
IFTHEN=(WHEN=(1,1,CH,EQ,C'H'),OVERLAY=(81:C'0')),
IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),OVERLAY=(81:C'9'))
SORT FIELDS=(81,1,CH,A,1,5,CH,A)
OUTREC FIELDS=(1,80)
/*
//SORTMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//CEEDUMP DD SYSOUT=* |
Input file used above is:
HLQ.HDR.TLR.FILE:
| Code: |
HDR
55555555
44444444
11111111
99999999
77777777
88888888
TLR
|
Output file:
HLQ.HDR.TLR.FILE.OUT
| Code: |
HDR
11111111
44444444
55555555
77777777
88888888
99999999
TLR
|
Above code must work on SyncSORT sites, if you face any problem ..please let me know.
By the way there had been discussion in the forum on reformatting records with 'IFTHEN' clause, please make a search. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|