View previous topic :: View next topic
|
Author |
Message |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Make the change pointed out by Pandora-Box. I would always include at least one space, so that I know I've got "get" not something which begins with "get".
Also look to your OMIT. You can't do SEQ like that. You need to define where the GROUP PUSHed the SEQ and then test that for one.
If this doesn't get it, post the whole sysout. |
|
Back to top |
|
|
knickraj Warnings : 1 New User
Joined: 11 Jun 2007 Posts: 50 Location: Euro
|
|
|
|
try this..
Code: |
//STEP EXEC SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABCDEFG.TXT
CD AAAAAA
CD BBBBBB
CD CCCCCCC
CD DDDDDDD
LOCSITE PRI=5 CY SEC=1 CY U=TESTDA REC=FB LR=1402 BLOCKSI=0
GET
USER.NONX.USER9999.SAMPLE(+1)'
QUIT
//SORTOUT DD DSN=&&T,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,BUILD=(80X),
HEADER1=('FILE,C''',1,11,'''')
//STEP EXEC SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&T,DISP=SHR
//SORTOUT DD SYSOUT=*
//SORTIN DD *
ABCDEFG.TXT
CD AAAAAA
CD BBBBBB
CD CCCCCCC
CD DDDDDDD
LOCSITE PRI=5 CY SEC=1 CY U=TESTDA REC=FB LR=1402 BLOCKSI=0
GET
USER.NONX.USER9999.SAMPLE(+1)'
QUIT
//SYSIN DD *
OPTION COPY
OMIT COND=(1,11,CH,EQ,FILE)
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'GET'),OVERLAY=(5:FILE)) |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
OUTFIL OMIT=(SEQ=1),BUILD=(1,80) |
Suggest you try removing
OMIT=(SEQ=1), and try again. |
|
Back to top |
|
|
mksranjani
New User
Joined: 03 Feb 2010 Posts: 29 Location: Chennai
|
|
|
|
I have tried removing OMIT. Below is the error i got
Code: |
SYSIN :
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=GROUP,RECORDS=9,PUSH=(81:ID=1)),
IFTHEN=(WHEN=(1,3,CH,EQ,C'get',AND,81,1,ZD,EQ,1),PUSH=(81:1,32))
*
OUTFIL BUILD=(1,80)
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What is the lrecl of the files? |
|
Back to top |
|
|
mksranjani
New User
Joined: 03 Feb 2010 Posts: 29 Location: Chennai
|
|
|
|
It is 80 bytes |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I have neither the documentation with me nor connectivity to a Syncsort system so i can't test.
PUSH=(81:1,32))
How was this determined?
Sorry i don't just have the answer, bit i'm kinda trying to deal with one error at a time . . . |
|
Back to top |
|
|
mksranjani
New User
Joined: 03 Feb 2010 Posts: 29 Location: Chennai
|
|
|
|
LRECL is 80 bytes, and the data in first line starts at col 1 with length 32.
Im not sure if this is correct. But I tried like this. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Infact the first push should suffice
Change ID=1 to 1,32
Use INCLUDE/OMIT to pic records that is needed then format GET record
Remove the second ifthen |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
here is a solution as has been suggested
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABCDEFG.TXT
CD AAAAAA
CD BBBBBB
CD CCCCCCC
CD DDDDDDD
LOCSITE PRI=5 CY SEC=1 CY U=TESTDA REC=FB LR=1402 BLOCKSI=0
GET +
USER.NONX.USER9999.SAMPLE(+1)'
QUIT
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,4,ZD)),
IFTHEN=(WHEN=GROUP,BEGIN=(81,4,ZD,EQ,+1),PUSH=(85:1,32))
OUTREC IFTHEN=(WHEN=(1,4,CH,EQ,C'GET '),
OVERLAY=(5:85,32))
OUTFIL OMIT(81,4,ZD,EQ,+1),BUILD=(1,80)
|
Gerry |
|
Back to top |
|
|
mksranjani
New User
Joined: 03 Feb 2010 Posts: 29 Location: Chennai
|
|
|
|
Gerry,
I tried the code you provided. Got the output as below. The data in first line is removed but it is not moved near 'get'.
Code: |
cd aaaaaa
cd bbbbbb
cd ccccccc
cd ddddddd
locsite pri=5 cy sec=1 cy u=testda rec=fb lr=1402 blocksi=0
get +
USER.NONX.USER9999.SAMPLE(+1)'
quit |
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
my get is in upper case, try changing it to lower case.
Gerry |
|
Back to top |
|
|
mksranjani
New User
Joined: 03 Feb 2010 Posts: 29 Location: Chennai
|
|
|
|
Gerry,
I changed it to lower case, and I got the expected result.
Great and thanks a lot! |
|
Back to top |
|
|
|