MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need help with a PLI program

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Wed Apr 26, 2006 6:19 am    Post subject: Need help with a PLI program Reply with quote

Hai All,

I have a requirement in PLI where in i have to read records one by one and i need to check the sequence number with the next record's sequence number ,if they are different i need to add some text 'EMPLOYEE WORKED' at the end of the output dataset.If the sequence numbers are equal i need not add the text 'EMPLOYEE WORKED' for the same sequence number.Can anybody help me out in the problem ?


TEST CASE1

Input dataset
-------------
Code:

000001
000001
000002

OUTPUT DATASET
--------------
Code:

000001  EMPLOYEE WORKED.
000001 
000002  EMPLOYEE WORKED.

TEST CASE2

Input dataset
-------------
Code:

000001
000001
000002
000002
000002
000002
000002
000003
000004
000005

OUTPUT DATASET
--------------
Code:

000001  EMPLOYEE WORKED.
000001 
000002  EMPLOYEE WORKED.
000002 
000002
000002
000002
000003  EMPLOYEE WORKED.
000004  EMPLOYEE WORKED.
000005  EMPLOYEE WORKED.

_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Apr 26, 2006 11:51 am    Post subject: Reply with quote

Shekhar123,

I am coding a PLI program after a long time. So I don't have time to check for performance.

[code:1:5f61e550bb]
PLISAMP: PROC OPTIONS(MAIN);
DCL INPUT1 FILE INPUT RECORD,
OUTPUT1 FILE OUTPUT RECORD SEQUENTIAL;

DCL IN_EOF BIT(1) INIT('0'B);

DCL 1 INPUT_REC,
3 INP_KEY CHAR(06),
3 IN_FILLER1 CHAR(01),
3 IN_COMMENT CHAR(15),
3 IN_FILLER2 CHAR(58);

DCL 1 SAVE_REC,
3 SAVE_KEY CHAR(06),
3 SAVE_FILLER1 CHAR(01),
3 SAVE_COMMENT CHAR(15),
3 SAVE_FILLER2 CHAR(58);

DCL W_PREV_KEY CHAR(6) INIT(' ');

OPEN FILE(INPUT1) INPUT,
FILE(OUTPUT1) OUTPUT;

ON ENDFILE(INPUT1) IN_EOF = '1'B;

READ FILE(INPUT1) INTO(INPUT_REC);
SAVE_REC = INPUT_REC;

DO WHILE (
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Thu Apr 27, 2006 12:37 am    Post subject: Reply with quote

Thanks Kolusu you are really great ,

Kolusu the pgm you wrote compiled successfullly with no erorrs, run successfully with the desired outputs.I would like to say thanks once again to the solution you gave me was really very very helpful in my necessity.The way you code and your approach is excellent.
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group