Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all 8500 articles
Browse latest View live

SYNCSORT :: RE: WER268A OUTREC STATEMENT : SYNTAX ERROR

$
0
0
Author: sergeyken
Posted: Mon Aug 28, 2017 9:52 pm (GMT 5.5)

I always recommend to any topic starter, not to be lazy, and carefully re-format his code presented to public - for code itself to be easier to understand (and to update during debugging).
Code:
 SORT FIELDS=COPY                                           
 OUTFIL REMOVECC,                                           
       BUILD=(1:C'SYSTEM',
             21:131,6,
             41:81,19,
             61:51,20,             
             82:C'SKEL-ALL-SYS-ISSUE',
            102:131,6,                 
            108:C'                   ',
            125:X),                 
       HEADER1=(1:C'UPDATER',
               21:C'PLUSS ID',
               41:C'LAST NAME',     
               61:C'FIRST NAME',
               82:C'TEMPLATE',
              102:C'PLUSS ID'),
       HEADER2=('')   

In this case it's getting easier also to temporary comment-out separate lines while debugging and testing it.
_________________
Tyrannosaurus-REXX


DB2 :: RE: Extract Data till prev hour

$
0
0
Author: Rohit Umarjikar
Posted: Mon Aug 28, 2017 11:04 pm (GMT 5.5)

What is not covered in the SQL, where do you think the query is not working? Do you have a timestamp column anywhere?
_________________
Regards,
Rohit Umarjikar
"Knowledge is knowing that a tomato is a fruit, but Wisdom is knowing not to put it in a fruit salad."icon_razz.gif

SYNCSORT :: RE: WER268A OUTREC STATEMENT : SYNTAX ERROR

$
0
0
Author: frozenblood87
Posted: Mon Aug 28, 2017 11:11 pm (GMT 5.5)

sergeyken wrote:
I always recommend to any topic starter, not to be lazy, and carefully re-format his code presented to public - for code itself to be easier to understand (and to update during debugging).
Code:
 SORT FIELDS=COPY                                           
 OUTFIL REMOVECC,                                           
       BUILD=(1:C'SYSTEM',
             21:131,6,
             41:81,19,
             61:51,20,             
             82:C'SKEL-ALL-SYS-ISSUE',
            102:131,6,                 
            108:C'                   ',
            125:X),                 
       HEADER1=(1:C'UPDATER',
               21:C'PLUSS ID',
               41:C'LAST NAME',     
               61:C'FIRST NAME',
               82:C'TEMPLATE',
              102:C'PLUSS ID'),
       HEADER2=('')   

In this case it's getting easier also to temporary comment-out separate lines while debugging and testing it.


Thank you, I found the issue. I had three extra spaces in the outrec.

I am getting a blank row inserted after every 59 records i.e., on multiples of 60. Is it that header2 is being written every time..How can I avoid that ? I just want the header2 to be written once.
_________________
Thanks

DB2 :: RE: Extract Data till prev hour

$
0
0
Author: balaji81_k
Subject: Reply to: Extract Data till prev hour
Posted: Mon Aug 28, 2017 11:17 pm (GMT 5.5)

Hi Rohit,

I didnt get your question. My understanding is You're asking whether i have a column timestamp ? yes we have a column Update_ts. I need to have this condition " current time - 1 hour " only when my sales date is equal to current date otherwise i need to pick up sales info of all hours of prev day . How to have this condition achieved using time stamp ? can you pls explain?
_________________
dear peoples,
i want to join these this group in order to
enrich my knowledge in mainframe.

DB2 :: RE: Extract Data till prev hour

$
0
0
Author: RahulG31
Subject: Reply to: Extract Data till prev hour
Posted: Mon Aug 28, 2017 11:45 pm (GMT 5.5)

Can you try something like:
Code:
SELECT DEPT_NBR, SALES_AMT,SALES_DATE,SALES_HR_NBR
 FROM DEPT_SALES TABLE
 WHERE DEPT = 100
 AND 
(
    (SALES_DATE BETWEEN  (CURRENT DATE - 3 DAYS) AND CURRENT DATE
 AND SALES_HR_NBR <= HOUR(CURRENT TIME - 1 HOUR)
 AND HOUR(CURRENT TIME) = 0)
                   OR
    (SALES_DATE BETWEEN  (CURRENT DATE - 2 DAYS) AND CURRENT DATE
 AND SALES_HR_NBR <= HOUR(CURRENT TIME - 1 HOUR)
 AND HOUR(CURRENT TIME) <> 0)
)
 ORDER BY SALES_DATE,SALES_HR_NBR
 WITH UR

SYNCSORT :: RE: WER268A OUTREC STATEMENT : SYNTAX ERROR

$
0
0
Author: sergeyken
Posted: Tue Aug 29, 2017 12:03 am (GMT 5.5)

frozenblood87 wrote:
I am getting a blank row inserted after every 59 records i.e., on multiples of 60. Is it that header2 is being written every time..How can I avoid that ? I just want the header2 to be written once.

You don't need HEADER2 at all. HEADER2 is specifically introduced to create page headers.

If you want to get empty line(s) after your HEADER1 (i.e. report header), just add "newline" parameter(s):
Code:
 . . . . .
 OUTFIL . . . . ,
      HEADER1=(. . . . . . . ,
              . . . . . . . . . ,
               ///)             skip 3 lines after the HEADER
 . . . . . .
 END

_________________
Tyrannosaurus-REXX

DB2 :: RE: Extract Data till prev hour

$
0
0
Author: balaji81_k
Posted: Tue Aug 29, 2017 1:14 am (GMT 5.5)

Rahul,

Sure i will try this and keep you posted . I guess the below " 3 DAYS ' is typo.

(SALES_DATE BETWEEN (CURRENT DATE - 3 DAYS) AND CURRENT DATE)
_________________
dear peoples,
i want to join these this group in order to
enrich my knowledge in mainframe.

DB2 :: RE: Extract Data till prev hour

$
0
0
Author: balaji81_k
Posted: Tue Aug 29, 2017 1:25 am (GMT 5.5)

Rahul,

I tried it but it pull sales for all dates with sales hour number <= current time(prev hour)
_________________
dear peoples,
i want to join these this group in order to
enrich my knowledge in mainframe.


DB2 :: RE: Extract Data till prev hour

$
0
0
Author: RahulG31
Posted: Tue Aug 29, 2017 1:28 am (GMT 5.5)

balaji81_k wrote:
Rahul,

Sure i will try this and keep you posted . I guess the below " 3 DAYS ' is typo.

(SALES_DATE BETWEEN (CURRENT DATE - 3 DAYS) AND CURRENT DATE)

No, it wasn't a typo.

I don't think the query will achieve what I think you want BUT the idea is that you have to go back 3 days (time 23:10) if your current hour is 0.

for example, if your job is running on 4th of August 00:10 then you would need the starting date as 1st of August i.e. CURRENT DATE - 3 DAYS, but if your job is running on 4th of August 01:10 then you would only need to go back 2 days.

You may need to do something with the hours though.

.

DB2 :: RE: Extract Data till prev hour

$
0
0
Author: RahulG31
Subject: Reply to: Extract Data till prev hour
Posted: Tue Aug 29, 2017 1:44 am (GMT 5.5)

Try this:
Code:
SELECT DEPT_NBR, SALES_AMT,SALES_DATE,SALES_HR_NBR
  FROM DEPT_SALES TABLE
  WHERE DEPT = 100
  AND 
 (
     (SALES_DATE = (CURRENT DATE - 3 DAYS) 
  AND SALES_HR_NBR >= HOUR(CURRENT TIME - 1 HOUR)
  AND HOUR(CURRENT TIME) = 0)
                    OR
     (SALES_DATE = (CURRENT DATE - 2 DAYS) 
  AND HOUR(CURRENT TIME) = 0)
 )
                    OR
     (SALES_DATE = (CURRENT DATE - 1 DAYS)
  AND HOUR(CURRENT TIME) = 0)
 )
                    OR
     (SALES_DATE =  (CURRENT DATE - 2 DAYS)
  AND SALES_HR_NBR >= HOUR(CURRENT TIME - 1 HOUR)
  AND HOUR(CURRENT TIME) <> 0)
                    OR
     (SALES_DATE = (CURRENT DATE - 1 DAYS)
  AND HOUR(CURRENT TIME) <> 0)
 )
 )
  ORDER BY SALES_DATE,SALES_HR_NBR
  WITH UR

*edited to change BETWEEN to =

All Other Mainframe Topics :: Failure after DIR command

$
0
0
Author: Hank Watson
Subject: Failure after DIR command
Posted: Tue Aug 29, 2017 3:14 am (GMT 5.5)

We have had two jobsteps on different days and in different directories successfully PUT a file. We then have a dir command and both have failed.
We run this job daily and there are dozens of FTP steps and it has run without these errors for years now and just recently we had these two failures (on different days).
The error message:
Code:
EZA1735I Std Return Code = 14426, Error Code = 00002
tells us that it was a DIR command (RC subcommand 14) and failed with a 426 error. Error Code 2 is FTP_SERVER_ERROR. This doesn't really tell me what happened.
Here's more specifics leading up to the error:
Code:

EZA1736I  dir                                             
PC0365 parseCmd: subcommand:  dir                         
SC1368 initDsConnection: entered                         
EZA1701I >>> PORT 10,7,209,10,52,210                     
200 Command PORT succeed                                 
EZA1701I >>> LIST                                         
426 Transfer failed                                       
CA1546 SETCEC code = 2                                   
CX0389 main: RC=-0001 cmd_in_progress=14                 
CX0392 main: last_reply= 426 err=02                       
PC0945 setClientRC: entered                               
PC1015 setClientRC: std_rc=14426, rc_type=STD, rc=14426   
EZA1735I Std Return Code = 14426, Error Code = 00002     
CZ1355 ftpQuit: entered                                   
CZ1436 ftpClose: entered                                 
CZ1436 ftpClose: entered                                 
EZA1701I >>> QUIT                                         
221 bye                                                   

All Other Mainframe Topics :: RE: Failure after DIR command

$
0
0
Author: Robert Sample
Subject: Reply to: Failure after DIR command
Posted: Tue Aug 29, 2017 7:24 am (GMT 5.5)

The 426 says the server is shutting down, or the data connection was closed (data set error is unlikely). Have there been ANY network changes of any kind recently? If so, that is probably what is causing your problem -- even simply changing out a switch or router could lead to FTP problems. If your network support group cannot identify any recent changes, you may have to have them do tracing of your jobs to figure out why the disconnects. And yes, this may take a while and be difficult to set up -- but unless you're getting data about line traffic on your FTP sessions, there is little to no chance you will be able to resolve this issue.
_________________
TANSTAAFL

The first rule of code reuse is that the code needs to be worth re-using.

"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." -- Donald Knuth

DFSORT/ICETOOL :: Repeat part of record multiple times

$
0
0
Author: Learncoholic
Subject: Repeat part of record multiple times
Posted: Tue Aug 29, 2017 11:33 am (GMT 5.5)

Hi,
I have a file with layout as:
Code:
AAA 123
BBB 345
CCC 4579
DDD 4578


I would like the O/P as:
Code:
AAA 123 AAA(Repeated 5 times)
BBB 345 BBB(Repeated 5 times)
CCC 4579 CCC(Repeated 5 times)
DDD 4578 DDD9Repeated 5 times)


Can you please suggest me?

Thanks
_________________
Thanks for not dumping it

JCL & VSAM :: Mainframe dataset split

$
0
0
Author: purushottam
Subject: Mainframe dataset split
Posted: Tue Aug 29, 2017 12:28 pm (GMT 5.5)

Hi ,

I have one Mainframe dataset say (xyz.psfile) which is having a particular sets of data , as below :-

123456789 --- header
aaaaaaaaaaaaa --- data
bbbbbbbbbbbbbbbb --- data
cccccccccccccc --- data
987654321 --- footer
123456789 --- header
aaaaaaaaaaaaa --- data
bbbbbbbbbbbbbbbb --- data
987654321 --- footer


Now this above format can be repeating any number of times in my Dataset (xyz.psfile) i.e. it is dynamic ,but with same ( header + data + footer) format .


What I need is , to run a job and split my Dataset into separate datasets with each having data from 1st header to 1st footer in one dataset ,2nd header to 2nd footer in 2nd dataset and so on.

Note :- number of headers and footers are dynamic so , we don't know how many headers and footers can come in my (xyz.psfile) .


Some one please guide me with appropriate solution using JCL .

JCL & VSAM :: RE: Mainframe dataset split

$
0
0
Author: Nic Clouston
Posted: Tue Aug 29, 2017 2:19 pm (GMT 5.5)

You cannot do this using JCL. You can use JCL to specify a program, probaby your sort product (whichever that is), and the resiurces required by the program. But you should know that as you have been a member for 10 years. You should alos know to use the code tags when presenting data.

Have you read the document on splitting data in various ways using DFSort? If not, why not? That is your first resource.
_________________
Regards
Nic


DFSORT/ICETOOL :: RE: Repeat part of record multiple times

$
0
0
Author: Nic Clouston
Posted: Tue Aug 29, 2017 2:21 pm (GMT 5.5)

PARSE and BUILD
_________________
Regards
Nic

All Other Mainframe Topics :: Skip file from delete

$
0
0
Author: pema_yozer
Subject: Skip file from delete
Posted: Tue Aug 29, 2017 3:19 pm (GMT 5.5)

HI guys,
I have a piece of code deleting files based on naming pattern

Code:
//DMS.SYSIN DD  *
 FIND DSNAME=EHLT.EC.TRAN.!KTEC!FILE         ** !=SELECT VARIABLE
  DELETE
/*


we also have few GDG created whose generations are also deleted by the JCL since it matches the pattern

EHLT.EC.TRAN.KTECBJ00.IFILE1.GDG
any idea on how I can make change the above code to it skips the GDG but continues to delete other file.

TSO/ISPF :: How to change a string containing the command delimiter

$
0
0
Author: chong.zhou
Subject: Re: find or replace command
Posted: Tue Aug 29, 2017 3:34 pm (GMT 5.5)

superk wrote:
Since I'm sure that you're aware that the semi-colon ';' is the command delimiter for ISPF, you can't do what you're trying that way. The easiest thing to do is to use the hex representation of the semi-colon instead:

C X'5E' X'40' ALL or C X'5E' ' ' ALL


Hi superK, but what if the semi-colons are in the middle of a string? Like below:

c 'A;B;C' 'A-B-C' all

I tried "AX'E5'B" and 'AX"E5"B', none worked. How do you put the X'5E' in the middle of a string? Thanks!

TSO/ISPF :: RE: How to change a string containing the command delimiter

$
0
0
Author: Marso
Posted: Tue Aug 29, 2017 4:27 pm (GMT 5.5)

It is better to start a new topic, even if the question is related.

Now, two correct answers:
1. it is always possible to do multiple changes (first change X'5E' to something unusual like ~ [X'A1'], then change 'A~B~C' to whatever, then back from X'A1' to X'5E')

2. Change the command delimiter (Option 0 for ISPF Settings, change command delimiter to something unusual like ~) then 'A;B;C' will work.

All Other Mainframe Topics :: RE: Skip file from delete

$
0
0
Author: Nic Clouston
Posted: Tue Aug 29, 2017 4:51 pm (GMT 5.5)

Remove the JCL statements that reference the generation data sets. (You said that they were being deleted by JCL and not by whatever utility you are running.)
_________________
Regards
Nic

Viewing all 8500 articles
Browse latest View live