Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Symbolic variables in SORT output

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Richard J

New User


Joined: 27 Mar 2009
Posts: 13
Location: London, UK

PostPosted: Wed Jul 01, 2009 9:58 pm    Post subject: Symbolic variables in SORT output
Reply with quote

Hi everyone,

Does anybody know how I can get a symbolic variable into an SORTs output file please?

In my JCL I have a symbolic variable set as...
Code:
DATE='01.07.2009'


...and then some JCL creating a report as shown below. I am hoping to find a way to insert the DATE value above into TRAILER1 where it says 'Date value here'. Can anybody point me the right way please? (I've removed the extra bits from the jcl for readability)

Code:

//SORT     EXEC PGM=SORT,COND=(4,LT)
//SYSOUT   DD   SYSOUT=*
//SORTIN   DD   DSN=<Input file>,DISP=SHR,LRECL=80
//REPOUT   DD   DSN=<Output file>,DISP=(NEW,CATLG),
//         SPACE=(20,(500,100),RLSE),AVGREC=U,
//         LRECL=75,RECFM=FBA
//SYSIN    DD   *
 SORT FIELDS=<some sort conditions>,
 SKIPREC=1
 SUM FIELDS=NONE
 OUTFIL FNAMES=REPOUT, REMOVECC,
 OUTREC=(1:1,9,15:57,10,28:47,9,40:11,35),LINES=5,
 HEADER2=(1:<various report header records>'),
 TRAILER1=(1:'END OF REPORT', 30:Date value here),
 TRAILER2=(1:' ')


Many thanks for your help.
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Jul 01, 2009 11:25 pm    Post subject:
Reply with quote

Richard,

Is the date value different from current date or an offset from current date?

DFSORT does have the capability of putting the current date and an offset to current date (current date + 7 or current date - 7)

If it is some other date then you can follow the example listed here

http://www.ibmmainframes.com/viewtopic.php?p=193544#193544
Back to top
View user's profile Send private message
Richard J

New User


Joined: 27 Mar 2009
Posts: 13
Location: London, UK

PostPosted: Thu Jul 02, 2009 1:36 pm    Post subject:
Reply with quote

Hi Skolusu.

Thankyou for your reply. I've had a read of your link and it looks like exactly the thing I need. I will give it a go today and post my results.

In answer to your question I will be using an offset of the current date, but this has the potential to change on a whim so having the ability to pass in a variable may be better than hard coding a 'give me today +1' into the sort. That said, it's a good fall back option if I can't get the other method to work.

Thankyou.
Back to top
View user's profile Send private message
Richard J

New User


Joined: 27 Mar 2009
Posts: 13
Location: London, UK

PostPosted: Thu Jul 02, 2009 3:36 pm    Post subject:
Reply with quote

I have spent some time trying out your suggestions Skolusu with mixed results.
The link you provided is superd and I have managed to find another use for it, unfortunately I have misunderstood how I am using the symbolic variables we have set up in my existing problem... on to plan B.

I have attempted to find out how to incorporate a date into the output as per your second suggestion but am running into difficulties understanding the examples in the documentation we have.

If I am using the below SYSIN to format the output, how can I insert a DATE1(.)+1 date value into the header only at position 50 please? I have tried various combinations and none seem to be hitting the mark.

Code:
SORT FIELDS=(63,4,CH,A,60,2,CH,A,57,2,CH,A,1,9,CH,A,47,9,CH,A),
SKIPREC=1
SUM FIELDS=NONE
OUTFIL FNAMES=REPOUT, REMOVECC
OUTREC=(1:1,9,15:57,10,28:47,9,40:11,35),
HEADER2=(1:'PMSMD28             ',
         22:'REPORT TITLE IS HERE  ',
         50:&DATE1(.)+1,60:'              ',/,
1:'COLUMN ONE ',15:'COLUMN TWO',28:'COLUMN THR',
40:'COLUMN NUMBER FOUR    ',/,
1:'------------',15:'----------',28:'----------',
40:'------------------------------'),
TRAILER1=(1:'END OF REPORT'),
TRAILER2=(1:' '),


Thankyou again for your help.
Rich
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jul 02, 2009 9:00 pm    Post subject:
Reply with quote

Richard,

Here is the complete JCL showing both methods

Code:

//RICHPROC PROC MYDATE=' '                           
//STEP0100 EXEC PGM=IKJEFT01,PARM='%RICHSYM &MYDATE'
//SYSTSPRT DD SYSOUT=*                               
//SYSPRINT DD SYSOUT=*                               
//SYSTSIN  DD DUMMY                                 
//SYSEXEC  DD DSN=RICHARD.ANY.PDS,DISP=SHR         
//OUTDD    DD DSN=RICARD.SYM,DISP=(,PASS),           
//            SPACE=(TRK,(1,0),RLSE),               
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920) 
//*                                                 
//STEP0200 EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SYMNAMES DD DSN=RICHARD.SYM,DISP=SHR                       
//SORTIN   DD DSN=Your input file,DISP=SHR                   
//REPOUT   DD SYSOUT=*                               
//SYSIN    DD DSN=RICHARD.PARM(SORTCARD),         
//            DISP=SHR                               
// PEND                                             
//GO       EXEC RICHPROC,MYDATE='2000.01.01'         



RICHSYM rexx exec

Code:

/* REXX */                                     
"ALLOC FI(OUTDD) DA('RICHARD.sym') SHR REUSE"   
PULL ARG                                       
QUEUE 'SYM1,C'''||ARG(1)||''''                 
"EXECIO 1 DISKW OUTDD (FINIS"                 
"FREE FI(OUTDD)"                               


RICHARD.PARM(SORTCARD) has the following
Code:

  OPTION SKIPREC=1                                               
  SORT FIELDS=(63,4,CH,A,60,2,CH,A,57,2,CH,A,1,9,CH,A,47,9,CH,A)
  SUM FIELDS=NONE                                               
  OUTFIL FNAMES=REPOUT,REMOVECC,                                 
  OUTREC=(1:1,9,15:57,10,28:47,9,40:11,35),                     
  HEADER2=(01:'PMSMD28            ',                             
           22:'REPORT TITLE IS HERE  ',                         
           50:SYM1,60:'              ',/,                       
           01:'COLUMN ONE ',15:'COLUMN TWO',28:'COLUMN THR',     
           40:'COLUMN NUMBER FOUR    ',/,                       
           01:'------------',15:'----------',28:'----------',   
           40:'------------------------------'),                 
  TRAILER2=(1:' '),                                             
  TRAILER1=(1:'END OF REPORT')                                   



If you want the current date +/- offset then use the following control cards. This will put the current date + 1 day in CCYY.MM.DD format on the header.

Code:

//SYSIN    DD *                                                   
  OPTION SKIPREC=1                                               
  SORT FIELDS=(63,4,CH,A,60,2,CH,A,57,2,CH,A,1,9,CH,A,47,9,CH,A) 
  SUM FIELDS=NONE                                                 
  OUTREC BUILD=(1:1,9,15:57,10,28:47,9,40:11,35,DATE1(.)+1)       
  OUTFIL FNAMES=REPOUT,REMOVECC,BUILD=(1,74),                     
  HEADER2=(01:'PMSMD28            ',                             
           22:'REPORT TITLE IS HERE  ',                           
           50:75,10,60:'              ',/,                       
           01:'COLUMN ONE ',15:'COLUMN TWO',28:'COLUMN THR',     
           40:'COLUMN NUMBER FOUR    ',/,                         
           01:'------------',15:'----------',28:'----------',     
           40:'------------------------------'),                 
  TRAILER2=(1:' '),                                               
  TRAILER1=(1:'END OF REPORT')                                   
Back to top
View user's profile Send private message
Richard J

New User


Joined: 27 Mar 2009
Posts: 13
Location: London, UK

PostPosted: Thu Jul 02, 2009 10:44 pm    Post subject:
Reply with quote

Fantastic!
I will incorprate both of your suggestions first thing tomorrow... two different problems solved with one solution!

Thankyou for all your help Skolusu.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us