I need to copy the Header(1st record) & Trailer of the 1st file (Last Record) , and Merge the other detail records from both the files to the O/P file
1st File - Header 1,3,CH,EQ,C'000'
Details records
1,3,CH,EQ,C'999'
2nd File - Header 1,3,CH,EQ,C'000'
Details records
1,3,CH,EQ,C'999'
O/P File - Header 1,3,CH,EQ,C'000' ( From 1st File ONLY)
Details records ( SORT condition given as below)
1,3,CH,EQ,C'999' ( From 1st File ONLY).
I have the Sort Condition for the other detail records, I need to know What condition we need to give to Merge the Header & Trailer from 1st File ONLY). Curretly the detail records ar merged correctly, please let me know your ideas.
Thanks & Regards,
Nivasya
SYSIN === SORT FIELDS=(1,22,CH,A,37,2,CH,A)
INCLUDE COND=((36,1,CH,EQ,C'D',OR,36,1,CH,EQ,C'C'),AND,
(1,3,CH,EQ,C'545'),AND,(28,3,CH,EQ,C'433',OR,
28,3,CH,EQ,C'111',OR,28,3,CH,EQ,C'222',OR,
28,3,CH,EQ,C'546'))
SUM FIELDS=(39,9,PD)
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
I couldn't get hchinnam's job to work, but even if it did work, it would be an inefficient solution. Here's a one pass DFSORT solution. I assumed the input files have RECFM=FB and LRECL=80, but the job could be changed appropriately for other attributes.
Can post your DFSMSG from job that has failed. We will be able to help you. As Frank suggested if there is a way to do it one pass obviously that is efficient.
That would be because of CTL3CNTL I guess. I tested the idea with my own CTL3CNTL before posting and it worked fine. So I replaced my CTL3CNTL with OP's statements and posted it.
Dear Frank and Hchinnam,
Please find the steps i have involved for the SORT pgm as we use this in our workshop which worked, but i need an effiecient way to code the below 3 steps to 1 / 2 step(s)
1st Step – As it is – COPY the recs as per the existing SORT CARD (NO inclusion of ‘000’, ‘999’)
2nd Step – Extract only the HDR & Trailer of 1st File
3rd Step – Merge the O/P of the 1st & 2nd Step.
This O/P will have the HDR & TRLR from 1st file and the Detail records as per the original SORT condition.
Please verify the SORT condition and request your expert Advice.
My JESYSMSG did not have much info, it says STEP was Excecuted with COND code as 16.
SYSOUT - i am not able to view- it says NO DATA SETS AUTHORISED'
usualy for other jobs i don't face this issue.
Thanks & Regards,
Venkat
but i need an effiecient way to code the below 3 steps to 1 / 2 step(s)
That is what Frank's JCL is doing. It does the JOB in one step and in one pass. And when I tested, it worked perfect.
Can you put an "S" on your job as shown below (in S;ST). and post all it's contents
Code:
Display Filter View Print Options Help
-----------------------------------------------------------------------------------------------------------
SDSF STATUS DISPLAY ALL CLASSES DATA SET DISPLAYED
COMMAND INPUT ===> SCROLL ===> CSR
NP JOBNAME JobID Max-RC Prty Queue C Pos SAff ASys Status PrtDest
s JOBID79K JOB06118 CC 0000 1 PRINT A 4300 LOCAL
JOBID79K JOB06112 JCL ERROR 1 PRINT A 4296 LOCAL
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
We use ONLY SORT Utility in our workshop.
Please let me know whether the above solution By Frank can be used in SORT utility
My solution uses the DFSORT utility. PGM=ICEMAN and PGM=SORT both invoke the sort utility used at your shop. Since you posted in the DFSORT Forum, I assume that's DFSORT.