Rambhupalchowdary
New User
Joined: 19 Aug 2010 Posts: 47 Location: Hyderabad
|
|
|
|
Hi,
I have a requirement, to sort all records except header. In output file i want header as it is and remaining detail records needs to be in sorted order.
I used below jcl in test environment, it worked because of having new version of DFSORT. In other environment still not yet upgraded. we can see below msg, it indicates the old version where datasort doesn't work.
ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1
So when i am trying to run below job it is giving RC 12.
Code: |
//SORT01 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=YYYYYY,DISP=SHR
//OUT DD DSN=xxxx,...
//TOOLIN DD *
COPY FROM(IN) TO(OUT)
DATASORT FROM(IN) TO(OUT) HEADER USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(11,20,CH,A)
/* |
ToolMsg :-
ICE630I 0 MODE IN EFFECT: STOP
COPY FROM(IN) TO(OUT)
ICE627I 0 DFSORT CALL 0001 FOR COPY FROM IN TO OUT COMPLETED
ICE602I 0 OPERATION RETURN CODE: 00
DATASORT FROM(IN) TO(OUT) HEADER USING(CTL1)
$
ICE614A 0 INVALID OPERATOR
ICE602I 0 OPERATION RETURN CODE: 12
Could anyone please tell me any alternative for this using DFSORT in single step if possible, to achieve same result.
Thanks,
Ram. |
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
You've not shown the input and expected output from that. Can header be identified by somehting, like 'HEDR' at first 4-positions.
By using a special key of '0' for the header record, '1' for the data records and '9' for the trailer records before the regular key, you can ensure that the header is first and details are after that and sorted. |
|