View previous topic :: View next topic
|
Author |
Message |
vijaycics
New User
Joined: 01 Jul 2005 Posts: 1
|
|
|
|
Hi People,
I have a question from my end. When we do a random or a sequential read of a VSAM file can we do like this.
Let me say file that i want to read are 'ABCD' and 'EFGH'.
IF condition one applies then I read 'ABCD' by moving the key to the key field of the file 'ABCD' else i read 'EFGH. So my code will be
Move key to gen-KEY
IF condition 1
Move 'ABCD' to ws-file-name
Else
Move 'EFGH' to ws-file-name
END-IF
EXEC CICS READ
DATASET(ws-file-name)
INTO (file-REC)
RIDFLD(gen-key)
LENGTH(WS-length)
RESP(WS-RESPONSE)
END-EXEC
Will this work? |
|
Back to top |
|
|
priya
Moderator
Joined: 24 Jul 2003 Posts: 568 Location: Bangalore
|
|
|
|
ws-file-name Must not be a variable. You must use a literal in DATASET / FILE field. |
|
Back to top |
|
|
sivamf
New User
Joined: 28 May 2005 Posts: 6
|
|
|
|
You have to Code two read comands with dataset names hardcoded
if true
read dataset"abcd"
else
read dataset "efgh"
end-if.
(put it in right syntax) |
|
Back to top |
|
|
sivamf
New User
Joined: 28 May 2005 Posts: 6
|
|
|
|
You have to code two read commands with two dataset names hard coded |
|
Back to top |
|
|
batu544
New User
Joined: 21 Jul 2005 Posts: 17 Location: bangalore
|
|
|
|
hi vijaycics,
U r right. U can code in that way . there is nothing wrong in ur coding style. |
|
Back to top |
|
|
batu544
New User
Joined: 21 Jul 2005 Posts: 17 Location: bangalore
|
|
|
|
hi vijaycics,
U r right. U can code in that way . there is nothing wrong in ur coding style. |
|
Back to top |
|
|
|