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
 

 

Easytrieve questions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> HomeWorks & Requests
View previous topic :: :: View next topic  
Author Message
rkkeane

New User


Joined: 18 May 2010
Posts: 2
Location: Hyderabad

PostPosted: Tue May 18, 2010 11:25 am    Post subject: Easytrieve questions
Reply with quote

Hi,

I have a doubt in the easytrieve code.Below is the easytrieve step given in the jcl. I do not understand the logic behind this code.

//STEP1 EXEC PGM=EASYTREV,REGION=999K
//STEPLIB DD DSN=CSIOSGP.EASYTREV.R1M0.LOAD,DISP=SHR
//SORTLIB DD DSN=CS.PPLNKLIB,DISP=SHR
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(2))
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(2))
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(2))
//SORTWK04 DD UNIT=SYSDA,SPACE=(CYL,(2))
//SORTWK05 DD UNIT=SYSDA,SPACE=(CYL,(2))
//SORTWK06 DD UNIT=SYSDA,SPACE=(CYL,(2))
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//CRDWK DD UNIT=SYSDA,SPACE=(TRK,(10,5))
//FILEB DD UNIT=SYSDA,SPACE=(TRK,(30,10))
//FILEA DD DSN=ZZO.D3121.FE6.DATA,DISP=SHR
//TABLEFL DD DSN=&&TBL1,DISP=(,PASS),
// SPACE=(TRK,(30,10),RLSE),UNIT=SYSDA
//SYSIN DD *
PARM SCANCOL=72 RPTMSG=NO RECFILL=NO SUPPRESS=ALL EOJMSG=NO
FILE FILEA FB-135-0 WORKAREA 152
ARG1 1 6 A ARG1X 136 6 A
FUNC1 34 11 A FUNC1X 142 11 A
ARG 1 6 A FUNC 7 11 A
SEQ*IN 18 4 P0 SEQ*OUT 18 4 P0
CNT*IN W 4 P0 CNT*OUT W 4 P0
9999
FILE FILEB FB-17-FULLTRK
9999
FILE TABLEFL FB-17-FULLTRK
9999
IF SORTED = YES THEN GO TO AFTERSORT
IF FILE = FILE
ARG1X = ARG1
FUNC1X = FUNC1
MOVE ARG1X 17 TO ARG
CNT*IN = CNT*IN + 1
SEQ*IN = CNT*IN
SUCCESS
AFTERSORT:
IF ARG CHANGED THEN
PUT TABLEFL FROM ARG 17
SORT ARG
//*ARS3 UTABLE DUPS=N,NAME=RECHECK,MAX=11417
//*ARS3 ARG=(FRMP,8)
//*ARS3 FUNC=(FRCITYST,34)
//STEP2 EXEC PGM=EASYTREV,REGION=999K
//STEPLIB DD DSN=CSIOSGP.EASYTREV.R1M0.LOAD,DISP=SHR
//SORTLIB DD DSN=CS.PPLNKLIB,DISP=SHR
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(2))
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(2))
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(2))
//SORTWK04 DD UNIT=SYSDA,SPACE=(CYL,(2))
//SORTWK05 DD UNIT=SYSDA,SPACE=(CYL,(2))
//SORTWK06 DD UNIT=SYSDA,SPACE=(CYL,(2))
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//CRDWK DD UNIT=SYSDA,SPACE=(TRK,(10,5))
//FILEB DD UNIT=SYSDA,SPACE=(TRK,(30,10))
//FILEA DD DSN=D3121.FE6.DATA,DISP=SHR
//TABLEFL DD DSN=&&TBL2,DISP=(,PASS),
// SPACE=(TRK,(30,10),RLSE),UNIT=SYSDA
//SYSIN DD *
PARM SCANCOL=72 RPTMSG=NO RECFILL=NO SUPPRESS=ALL EOJMSG=NO
FILE FILEA FB-135-0 WORKAREA 152
ARG1 8 6 A ARG1X 136 6 A
FUNC1 34 11 A FUNC1X 142 11 A
ARG 1 6 A FUNC 7 11 A
SEQ*IN 18 4 P0 SEQ*OUT 18 4 P0
CNT*IN W 4 P0 CNT*OUT W 4 P0
9999
FILE FILEB FB-17-FULLTRK
9999
FILE TABLEFL FB-17-FULLTRK
9999
IF SORTED = YES THEN GO TO AFTERSORT
IF FILE = FILE
ARG1X = ARG1
FUNC1X = FUNC1
MOVE ARG1X 17 TO ARG
CNT*IN = CNT*IN + 1
SEQ*IN = CNT*IN
SUCCESS
AFTERSORT:
IF ARG CHANGED THEN
PUT TABLEFL FROM ARG 17
SORT ARG
//STEP3 EXEC PGM=EASYTREV, 585K,
// PARM='SYSIN=EZTARS',REGION=4096K
//STEPLIB DD DSN=CSIOSGP.EASYTREV.R1M0.LOAD,DISP=SHR
// DD DSN=CSIOSGP.ANALYTIC.R10.LOAD,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//*ARS3 DATAIN=(CARTRN,2)
//FILEA DD DSN=FLRSACP.AC020902.F01.WKLYMRG(-1),DISP=OLD,
// UNIT=(CTAPE,,DEFER)
//*ILEA DD DSN=CREVACP.AC0195PP.F04.DAILYSRT(-0),DISP=OLD,
//* UNIT=(TAPE,,DEFER)
//* DD DSN=CREVACP.AC0195PP.F04.DAILYSRT(-00),DISP=SHR,
//* UNIT=AFF=FILEA,DCB=BLKSIZE=32724
//CHECK DD DSN=&&TBL1,DISP=(OLD,DELETE)
//RECHECK DD DSN=&&TBL2,DISP=(OLD,DELETE)
//FILEB DD DSN=D3121.ARS.CARTRN.T02WK410.DATA,
// DISP=(NEW,CATLG,DELETE),
//* SPACE=(CYL,(300,25)),UNIT=SYSDA,BUFNO=20
// UNIT=(CTAPE,,DEFER),LABEL=EXPDT=98040
//CRDWK DD UNIT=SYSDA,SPACE=(CYL,(2,2))
//SYSIN DD *
PARM SCANCOL=72 DECALIGN=YES RECFILL=NO TABLSIZ=585K
*ARS3 LOG D3121 8539NYNNNNNP07WK39595072411341151CARTRN 2 -S1
*ARS3 LOG 'FLRSACP.AC020902.F01.WKLYMRG(0)'
FILE FILEA FB-404-0 WORKAREA 808
*D3121 CARTRN
PRECOLL 1 1 A TARE 2 4 N0 CANTANK 6 1 A
CANTRAF 7 1 A PRIORERR 8 1 A POSTERR 9 1 A
TODIV 10 1 A TRAIN1 11 1 A TRFRTAG 12 1 A
CNTRLCODE 13 1 A TRAIN26 14 5 A TRAIN234 14 3 A
TRNFROM 19 6 A TRAIN3 14 3 A
TRNTO 25 6 A TRNDEP 31 8 A FRMP 39 6 A
TOMP 45 6 A DEP 51 10 A ARR 61 10 A
DATE 51 6 A TIME 57 4 A
DEPDATE 51 6 A DEPTIME 57 4 A
DEPHR 57 2 A DEPMN 59 2 A
ARRDATE 61 6 A ARRTIME 67 4 A
ARRHR 67 2 A ARRMN 69 2 A
MOVETYPE 71 1 A CREWCODE 72 1 A SRCTERM 73 3 A
MSGNUM 76 3 A RECDDATE 79 5 A MSGRECNU 84 3 A
OFFCTAG 87 1 A CARDCODE 88 1 A CARID 89 10 A
INIT 89 4 A NUMBER 93 6 A UNIT 95 4 A
CARKIND 99 1 A ORIGRDN 100 3 A ORIGFSAC 103 5 A
WBDTE 108 3 A WBNUM 111 6 A NETONS 117 3 N0
STCC 120 7 A STCCSUB 127 1 A DESTCITY 128 9 A
S2 120 2 A
DESTST 137 2 A CONSIGN 139 9 A SHIPPER 148 9 A
DESTRDI 157 3 A SBDOFFPT 160 6 A KEYPCHSTA 166 2 A
JAMESTAG 168 1 A KEYPCHOPR 169 1 A LORE 170 1 A
POOLRD 171 1 A BUM 172 1 A FORCERRTE 173 1 A
ORIGRDI 174 4 A ORIGCITY 178 9 A CSXPOOL 187 4 A
ORIGST 191 2 A OWNCODE 193 1 A CARCNT 194 1 N0
AARTYPE 195 4 A AARFIRST 195 1 A
RATETYPE 199 1 A TIMRT 200 4 N2
MIRATE 204 4 N3 OWNINIT 208 4 A MSTRKIND 212 1 A
CS11 213 2 A ALPHAOWN 215 1 A CARGRADE 216 1 A
INTER 217 6 A MILES 223 5 N1 UNMILEDTA 228 1 A
FROMFSAC 229 6 A CONTENTS 235 6 A TOFSAC 241 6 A
CSXONJCTN 247 6 A CSXOFFPT 253 6 A OFFPTTAG 259 1 A
ATIMERT 260 4 N2 AMIRATE 264 4 N3 AAPRT 268 4 N2
SPLC 272 6 A CONTRACT 278 10 A ABANDON 288 1 A
RESTRTAG 289 1 A SBDONJCTN 290 6 A TRNDEPYR 296 2 A
APPRT 298 4 N2 RECDTIME 302 4 A HGHWYTAG 306 1 A
ORIGBLK 307 3 A DESTBLK 310 3 A CONSSEQ 313 6 A
LESSEEINI 319 4 A ROADCODE 323 1 A RACKINIT 324 6 A
AUTOCODE 330 1 A ACCTCODE 331 1 A PDETCODE 332 1 A
FLATID 333 10 A RTERD1 343 3 A RTERD2 346 3 A
RTERD3 349 3 A RTERD4 352 3 A RTERD5 355 3 A
RTERD6 358 3 A RTERD7 361 3 A RTERD8 364 3 A
RTERD9 367 3 A CSXRDCOD 370 1 A SHIPPATRO 371 6 A
CONSPATRO 377 6 A FROMCITY 383 9 A FROMST 392 2 A
TOCITY 394 9 A TOST 403 2 A
*ARS3 USRVAR:
*ARS3 LOC='RTERD7'
TRAIN 361 1 A
*ARS3 LOC='TRAIN'
TRAIN1X 361 1 A
*ARS3 LOC='TRAIN+1'
TRAIN26X 362 5 A
*ARS3 LOC='TRAIN+1'
TRAIN3 362 5 A
*ARS3 LOC='TRAIN'
SYMBOL 361 4 A
*ARS3 LOC='TRAIN+4'
TRAIN2 365 2 A
*ARS3 LOC='AARTYPE'
AAR 195 1 A
*ARS3 LOC='DEP'
DEPDATE 51 6 A
*ARS3 LOC='DEP+4'
DEPDAY 55 2 A
*ARS3 LOC='ARR'
ARRDATE 61 6 A
*ARS3 LOC='TRAIN+1'
TRAIN3 362 3 A
*ARS3 LOC='FROMCITY'
FRCITYST 383 11 A
*ARS3 LOC='TOCITY'
TOCITYST 394 11 A
*ARS3 LOC='FROMCITY'
FRCITY 383 9 A
*ARS3 LOC='FRCITY'
FRCITY6 383 6 A
*ARS3 LOC='TOCITY'
TOCITY6 394 6 A
OTHERS S 5 P0
*ARS3 END USRVAR:
COUNT W 1 N WSW W 1 N FIRSTBYTE 1 1 A
WRECORD 405 1 A
CYCLECNT W 4 P0
CYCLEMAX W 4 P0
9999
FILE FILEB FB-404-23432
9999
FILE CHECK TABLE
*ARG=6 ,FUNC=11
9999
FILE RECHECK TABLE
*ARG=6 ,FUNC=11
9999
IF FILE = FILE THEN
MOVE FIRSTBYTE 404 TO WRECORD
CYCLECNT = 1
ELSE
NEXTCOPY: MOVE WRECORD 404 TO FIRSTBYTE
*ARS3 USER_LOGIC START
IF CNTRLCODE = P,*,N
FLUNK
IF FILE = FILE
TRAIN1X = TRAIN1
TRAIN26X = TRAIN26
IF TRAIN = ( FILL )
SYMBOL = (FILL)
TRAIN2 = DEPDAY
IF CARDCODE = 1
AND MOVETYPE = 3
AND AAR = P,Q,U,S,Z
GO TO ULTIMATE
IF MOVETYPE NQ 3,5
*AND MILES GR 0
AND AAR = P,Q,U,S,Z
GO TO ULTIMATE
IF TRAIN1 = Q,R,L,S,X
AND TRAIN3 = 100-199
AND CARDCODE = 1
AND MOVETYPE = 3
GO TO ULTIMATE
IF MOVETYPE = 1,2,6,7,J
AND AAR = P,Q,U,S,Z
GO TO ULTIMATE
ELSE FLUNK
ULTIMATE:
IF FILE = FILE
FRCITYST = *
TOCITYST = *
IF FRCITYST = * THEN FRCITYST = CHECK TRNFROM
IF TOCITYST = * THEN TOCITYST = CHECK TRNTO
IF FRCITYST = * THEN FRCITYST = RECHECK TRNFROM
IF TOCITYST = * THEN TOCITYST = RECHECK TRNTO
IF FRCITYST = * THEN FRCITY6 = FRMP
OTHERS = OTHERS + 1
IF TOCITYST = * THEN TOCITY6 = TOMP
OTHERS = OTHERS + 1
IF FILE = FILE
SUCCESS
ELSE FLUNK
*ARS3 USER_LOGIC END
WRITE
FINALS OTHERS
//STEP4 EXEC PGM=IEFBR14,COND=(4,GE,STEP1)
//DDX DD DISP=(OLD,DELETE),DSN=*.STEP1.FILEB
//DDY DD DISP=(OLD,UNCATLG),DSN=*.STEP1.FILEB
/* REPLACE MEMBER=CARTRNTP VERS=5
//


Questions from the above code:
1. Can some one tell how the above code works.
2. What will be the default value for SORTED field.
3. How the statement "MOVE ARG1X 17 TO ARG" will work though ARG is the 6 byte field declared.
4. Can some one say the meaning for 'flunk'.
IF FILE = FILE
SUCCESS
ELSE FLUNK
5. What is "FINALS OTHERS"
6. How this move statement will work if firstbyte is a one byte field.
" MOVE WRECORD 404 TO FIRSTBYTE"
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 -> HomeWorks & Requests All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Easytrieve report shalem CA Products 4 Sun Feb 26, 2017 9:08 am
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Viewing executing process in NDM .. q... Debb.Brant IBM Tools 0 Wed Dec 14, 2016 10:55 pm


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