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

SORT : Select the records matching the current date


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

Active User


Joined: 17 Oct 2004
Posts: 191
Location: hyderabad

PostPosted: Thu Jan 21, 2010 7:34 pm
Reply with quote

Hi All,

I need some help with respect to sort.

MY input file will be updated on a daily basis and the date called Transaction Date (in DDMMYY format) at position 35 of the file helps to identify the records added/modified.

My requirement is to select the records for the current date. I searched the manuals but not able to find the date variable in which gets system date in DDMMYY format (the DATE1 , DATE2 varaibles are in some other formats)

Examples
INPUT FILE
(Date in DDMMYY format from 35-41 Position)
001XXXXXXXXXABCDEFGZURICHINSURANCE200110C15518188
001XXXXXXXXXABCDEFGZURICHINSURANCE210110C15518188
001XXXXXXXXXABCDEFGZURICHINSURANCE220110C15518188

If the Job is run on 21st Jan 2010 need to retrieve only 2nd record

If the Job is run on 22nd Jan 2010 need to retrieve only 3rd record

Can this we done using the INCLUDE statement itself ...


Thanks n regards
prasad
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jan 21, 2010 11:08 pm
Reply with quote

You can use DFSORT Symbols to get a DDMMYY date.

Code:

//SYMNAMES DD *           
CURDT,S'&DAY.&MON.&YR2'   


You can then use CURDT as you would DATE1.

Code:

   INCLUDE COND=(35,6,CH,EQ,CURDT)
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Jan 22, 2010 3:21 am
Reply with quote

Hi Frank,

using your above example, I'm getting the date of 210110 instead of 220110

JCL used follows
Code:
//S1       EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//SYMNAMES DD *                                 
CURDT,S'&DAY.&MON.&YR2'                         
//SORTIN   DD *                                 
DUMMY REC                                       
/*                                               
//SORTOUT  DD SYSOUT=*                           
//SYSIN    DD *                                 
  OPTION COPY                                   
  INREC  BUILD=(1:CURDT)                         
/*


SYSOUT ouput, you can see the date it ran on ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 08:34 ON FRI JAN 22, 2010
Code:
1ICE270I 0 PROCESSING SYMNAMES STATEMENTS
 ICE280I 1 ORIGINAL STATEMENTS FROM SYSIN    FOLLOW
             OPTION COPY
             INREC  BUILD=(1:CURDT)
 ICE282I 0 PERFORMING SYMBOL SUBSTITUTION AS NEEDED
 ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED
 ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
 ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 08:34 ON FRI JAN 22, 2010 -
0            OPTION COPY
            INREC BUILD=(1:C'210110')
 ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1
 ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E9-K90007 C9-BASE   E5-K31980 E7-K24705
 ICE193I 0 ICEAM1 ENVIRONMENT IN EFFECT - ICEAM1 INSTALLATION MODULE SELECTED
 ICE088I 0 CSCSGLBI.S1      .        , INPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
 ICE093I 0 MAIN STORAGE = (MAX,6291456,6278238)
 ICE156I 0 MAIN STORAGE ABOVE 16MB = (6200948,6200948)
 ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,RESET=Y,VSAMEMT=Y,DYNSPC=256
 ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ERET=ABEND,MSGDDN=SYSOUT
 ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=FULL ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=N,DYNALOC=N             ,ABCODE=MSG
 ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=N,CKPT=N,STIMER=Y,COBEXIT=COB2
 ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=Y,DSA=0
 ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE    ,EXITCK=S,PARMDDN=DFSPARM ,FSZEST=N
 ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMIO=N,MOSIZE=MAX
 ICE235I 0 OPTIONS: NULLOUT=RC0
 ICE084I 0 BSAM ACCESS METHOD USED FOR SORTOUT
 ICE084I 0 BSAM ACCESS METHOD USED FOR SORTIN
 ICE751I 1 EF-K10929 F0-K30362 E8-K24705
 ICE090I 0 OUTPUT LRECL = 6, BLKSIZE = 6, TYPE = FB
 ICE171I 0 SORTOUT LRECL OF 6 IS DIFFERENT FROM SORTIN(NN) LRECL OF 80 - RC=0
 ICE055I 0 INSERT 0, DELETE 0
 ICE054I 0 RECORDS - IN: 1, OUT: 1
 ICE052I 0 END OF DFSORT



Gerry
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Jan 22, 2010 3:30 am
Reply with quote

Probably has to do with LOCAL time. Try using the local system variables like this:

Code:

//SYMNAMES DD *             
CURDT,S'&LDAY.&LMON.&LYR2' 
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Jan 22, 2010 3:51 am
Reply with quote

Hi Frank,

LOCAL time worked, can you explain where the 2 times are obtained from ?

Current system date and time is
Code:
TIME-09:17:47 AM. CPU-00:00:05 SERVICE-1234 SESSION-01:03:30 JANUARY 22,2010


Does the same apply to other date functions ?


Gerry
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Jan 22, 2010 5:22 am
Reply with quote

gcicchet,

&LDAY , &LMON , &LYR2 are all system symbols. Here is an explanation of those symbols

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA1E241/2.2.2?DT=20001025161613#FIGBLECK1
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Jan 22, 2010 5:28 am
Reply with quote

Thanks Kolusu

Gerry
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
Search our Forums:

Back to Top