Page 1 of 1

report creation in sort.

PostPosted: Wed Mar 20, 2013 4:54 pm
by luckyboyroh
hey guys,

Need your help. My requirement is currently there is a report which needs to be changed. The Current report does not have header information and the new report should have the header details. can this be acheived through sort?
===============================================================
Current Report [Doesnt have header details]

ABC COMPANY PAGE : 1
XXXXXXXXXXXXXXXXXXXXX
YYYYYYYYYYYYYYYYYYYYY

BCD COMPANY PAGE : 2
ZZZZZZZZZZZZZZZZZZZZZZ
AAAAAAAAAAAAAAAAAAA
===============================================================
New Report [header details needs to be added]

Report date:
Report ID :
Run Date :

ABC COMPANY PAGE : 1
XXXXXXXXXXXXXXXXXXXXX
YYYYYYYYYYYYYYYYYYYYY

Report date:
Report ID :
Run Date :

BCD COMPANY PAGE : 2
ZZZZZZZZZZZZZZZZZZZZZZ
AAAAAAAAAAAAAAAAAAA
===============================================================

The thing is the header details needs to be inserted for every page. Please help me whether this can be acheived through sort. Thanks

Thanks,
Rohit

Re: report creation in sort.

PostPosted: Wed Mar 20, 2013 5:18 pm
by luckyboyroh
I am using the below sort card but getting error .

SORT FIELDS=(COPY)
OUTFIL HEADER2=(001:'REPORT DT:',
012:&DATE=(MD4/),
001:'REPORT ID: ',
012:AAAAAA',/,
001:'Run Date:
012:&DATE=(MD4/))
TRAILER1=LINES=55

ERROR
TRAILER1=LINES=55
*
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

plz help..

Re: report creation in sort.

PostPosted: Wed Mar 20, 2013 6:27 pm
by BillyBoyo
Have a look at your manual for syntax and examples of TRAILER1. Search for examples here. Google. Experiment. Correct.

Re: report creation in sort.

PostPosted: Thu Mar 21, 2013 10:42 am
by bodatrinadh
Hi Rohit,

You may try this code -

//STEP01 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SORTOUT  DD SYSOUT=*
//SORTIN   DD *       
ABC COMPANY PAGE : 1 
XXXXXXXXXXXXXXXXXXXXX
YYYYYYYYYYYYYYYYYYYYY
                     
BCD COMPANY PAGE : 2 
ZZZZZZZZZZZZZZZZZZZZZZ
AAAAAAAAAAAAAAAAAAA   
                     
AZA COMPANY PAGE : 3 
TTTTTTTTTTTTTTTTTTTTTT
QQQQQQQQQQQQQQQQQQQ   
//SYSIN   DD *
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(13,4,SS,EQ,C'PAGE'),PUSH=(81:ID=4),
                            END=(1,1,CH,EQ,C' '))
  SORT FIELDS=COPY
  OUTFIL REMOVECC,OUTREC=(1,80),SECTIONS=(81,4,
          HEADER3=(001:'REPORT DT:',012:&DATE=(MD4/),/,
                   001:'REPORT ID:',012:'AAAAAA',/,
                   001:'RUN DATE: ',012:&DATE=(MD4/)),SKIP=L)


Output:-

REPORT DT: 03/21/2013
REPORT ID: AAAAAA     
RUN DATE:  03/21/2013
ABC COMPANY PAGE : 1 
XXXXXXXXXXXXXXXXXXXXX
YYYYYYYYYYYYYYYYYYYYY
                     
REPORT DT: 03/21/2013
REPORT ID: AAAAAA     
RUN DATE:  03/21/2013
BCD COMPANY PAGE : 2 
ZZZZZZZZZZZZZZZZZZZZZZ
AAAAAAAAAAAAAAAAAAA   
                     
REPORT DT: 03/21/2013
REPORT ID: AAAAAA     
RUN DATE:  03/21/2013
AZA COMPANY PAGE : 3 
TTTTTTTTTTTTTTTTTTTTTT
QQQQQQQQQQQQQQQQQQQ   

Re: report creation in sort.

PostPosted: Thu Mar 21, 2013 1:04 pm
by luckyboyroh
thanks mate! i tired this but getting the below error. please help. also would like to know the significance of "PUSH" field as why (81:ID=4) mentioned. thanks in advance.
INREC IFTHEN=(WHEN=GROUP,BEGIN=(121,4,SS,EQ,C'PAGE'),PUSH=(134:ID=4),
*
END=(1,1,CH,EQ,C' '))
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT

Re: report creation in sort.

PostPosted: Thu Mar 21, 2013 1:24 pm
by bodatrinadh
I guess your sort control cards (INREC IFTHEN..) in SYSIN DD * is starting from Position 1. It should be from Position 2. Show us your complete JCL what you have tried...

also would like to know the significance of "PUSH" field as why (81:ID=4) mentioned.


Here PUSH is used to define the input field, sequence number, or identifier that will be overlaid for each group’s records.

ID=n Specifies a printable Zoned Decimal (ZD) identifier n bytes long, which will be added to every record of each group.
For the first group,the identifier will start at 1 and for each subsequent group it will be increased by 1. The number n can be from 1 to 15.

Re: report creation in sort.

PostPosted: Thu Mar 21, 2013 1:31 pm
by luckyboyroh
thanks! It worked. It was a silly one. Didnt notice it properly. just one more question. i dont want the Cariage return variable. how to modify the same?

Re: report creation in sort.

PostPosted: Thu Mar 21, 2013 1:44 pm
by bodatrinadh
i dont want the Cariage return variable. how to modify the same?


Cariage return variable ? No clue on that...Can you show the sample???

Re: report creation in sort.

PostPosted: Fri Mar 22, 2013 3:59 am
by BillyBoyo
You print the Printer Control Codes in position one on the output? That's what the REMOVECC should do, so provide the information -3nadh asked for.

Re: report creation in sort.

PostPosted: Fri Mar 22, 2013 11:54 am
by luckyboyroh
Sorry. Jus now logged in. Yes 3Nadh. Billyboyo is correct . Thats what i was looking for. I tried the same REMOVE CC yesterday and it worked. Thanks a lot 3nadh! thanks again.