IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

User Abend 16 while trying sort condition


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
srini1528
Currently Banned

New User


Joined: 25 Apr 2007
Posts: 13
Location: INDIA

PostPosted: Thu May 17, 2007 4:26 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu May 17, 2007 4:37 pm
Reply with quote

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
View user's profile Send private message
srini1528
Currently Banned

New User


Joined: 25 Apr 2007
Posts: 13
Location: INDIA

PostPosted: Thu May 17, 2007 5:17 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Thu May 17, 2007 7:05 pm
Reply with quote

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
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Alternative of JoinKeys in SORT DFSORT/ICETOOL 2
No new posts Sort SMF records? SYNCSORT 6
No new posts To Sort detail records in a file with... SYNCSORT 5
No new posts Avoid job abend on dataset held by us... JCL & VSAM 6
No new posts Filter records where condition is in ... SYNCSORT 6
Search our Forums:


Back to Top