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

Easytrive File manipulation


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vin12pr
Warnings : 1

New User


Joined: 14 Jun 2006
Posts: 56

PostPosted: Thu Sep 06, 2007 4:38 pm
Reply with quote

Hi All,

I have a problem with one of my Eztreive programs.

Functionality of my Program:

The program receives a input which is of length 1764 .... My program reads the input record and updats the sort indicator with either A or B in the 242th position of the input record and then writes the same in to output file.The copy layout is same for both the input and output.

I am not understanding as to what happening in the middle the ouput contains some extra Junk data which is ultiamtely affecting the output.There is a lot of difference between input and output even though i am updating onlyone field in the input before writing it to the output.


What might be happening in between..Any idea?

Thanks in advance,
Vin12pr
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Sep 06, 2007 4:42 pm
Reply with quote

Can you post a small example of the file descriptions and the program logic?
Back to top
View user's profile Send private message
vin12pr
Warnings : 1

New User


Joined: 14 Jun 2006
Posts: 56

PostPosted: Thu Sep 06, 2007 5:24 pm
Reply with quote

FILE CM200IN VB(1768 27998)
*---------------------------------------
*FIELD COLS SIZE TYPE
*---------------------------------------
INREC 1 1764 A

WS-AGENT-ST 134 2 N
WS-AGENT-DS 136 2 N
WS-AGENT-AG 139 2 N
SORT-IND 242 1 A
AGT-ST-DS 243 3 P
AGENT-NBR 246 2 N
PNR-NAME 1267 40 A
*
FILE ELITELST VS
*-----------------------------------------
*FIELD COLS SIZE TYPE
*-----------------------------------------
ELITE-KEY 1 8 A
WS-ELT-AGENT-ST 1 2 N
DASH1 3 1 A
WS-ELT-AGENT-DS 4 2 N
DASH2 6 1 A
WS-ELT-AGENT-AG 7 2 N
*
FILE CM200OUT VB(1768 27998)
OUTREC 1 1764 A

*
AGT-KEY W 8 A
AGT-ST AGT-KEY 2 A
AGT-DASH1 AGT-KEY +2 1 A
AGT-DT AGT-KEY +3 2 A
AGT-DASH2 AGT-KEY +5 1 A
AGT-AGN AGT-KEY +6 2 A
*
WS-AGENT-REFORMAT W 06 A
WS-AGENT-STATE WS-AGENT-REFORMAT 02 N
WS-AGENT-DISTRICT WS-AGENT-REFORMAT +2 02 N
WS-AGENT-NUMBER WS-AGENT-REFORMAT +4 02 N
WS-AGENT-NUMERIC WS-AGENT-REFORMAT 04 N
*

JOB INPUT CM200IN
*
* MOVE SPACES TO OUTREC
* MOVE INREC TO OUTREC
* DISPLAY PNR-POL 'TEST FIELDA1267-', PNR-NAME
* DISPLAY PNR-POL-O 'TEST FIELDB1267-', PNR-NAME-O
AGT-ST = WS-AGENT-ST
AGT-DASH1 = '-'
AGT-DT = WS-AGENT-DS
AGT-DASH2 = '-'
AGT-AGN = WS-AGENT-AG

WS-AGENT-STATE = WS-AGENT-ST
WS-AGENT-DISTRICT = WS-AGENT-DS
WS-AGENT-NUMBER = WS-AGENT-AG

READ ELITELST KEY AGT-KEY STATUS
IF ELITELST:FILE-STATUS = 0
SORT-IND = 'A'
ELSE
SORT-IND = 'B'
END-IF

AGT-ST-DS = WS-AGENT-NUMERIC
AGENT-NBR = WS-AGENT-NUMBER

OUTREC = INREC
*PUT CM200OUT FROM CM200IN
PUT CM200OUT

END


Here what I am doing is ....I will read the input record...The agent numbe r in the input record will be compared against agent file ... if its there then i will populate the sort indicator with A or B . then writeit to ouput file.



THis is what all I m doing..but there is a lot of difference between input and ouput generated.

Thnx,

Vin12pr
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Sep 06, 2007 5:41 pm
Reply with quote

Looks good to me....
I'm a bit confused by this:
WS-AGENT-STATE = WS-AGENT-ST
2 N to 2 N
WS-AGENT-DISTRICT = WS-AGENT-DS
2 N to 2 N
WS-AGENT-NUMBER = WS-AGENT-AG
2 N to 2 N
.
.
.
AGT-ST-DS = WS-AGENT-NUMERIC
Why move what was WS-AGENT-ST & WS-AGENT-DS to AGT-ST-DS?
AGENT-NBR = WS-AGENT-NUMBER
Why move what was WS-AGENT-AG to AGENT-NBR?
Back to top
View user's profile Send private message
vin12pr
Warnings : 1

New User


Joined: 14 Jun 2006
Posts: 56

PostPosted: Thu Sep 06, 2007 6:48 pm
Reply with quote

Is somethign happening during the PUT statment ???bcoz the output data is getting a whole lot of junk.

Kindly advise



Thanks,
Vin12pr
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Sep 06, 2007 10:31 pm
Reply with quote

Hello,

The problem is most likely not the PUT.

Quote:
output data is getting a whole lot of junk.

Please post some of the "junk" (in hex) as well as the input that was in process at the time.

When we see what youj have, we may be able to offer suggestions.
Back to top
View user's profile Send private message
rohitsir

New User


Joined: 21 Aug 2007
Posts: 32
Location: USA

PostPosted: Fri Sep 07, 2007 2:09 am
Reply with quote

Hi,

I did face this problem once. I don't know the exact reason but this is wut i did to get rid of it:

Dump your input file values to working storage fields. Do wutever modification you have to do with your working storage variables and not with file variables. Write the output file from working storage variables.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Fri Sep 07, 2007 10:31 am
Reply with quote

Hi vin12pr,


Put display befor putting to o/p file & let us know the result
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 -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top