A cikin duniyar babban kwamfuta, Hanyar Samun Ma'ajiyar Wuta (VSAM) ta zama ginshiฦi na asali. Yana ba da damar adanawa, samun dama, da sarrafa bayanai ta hanyar samar da ayyuka fiye da sauฦi na tsari da hanyoyin ajiya kai tsaye. Yin aiki tare da fayil ษin STATUS VSAM ya ฦunshi amfani da Cobol, yaren shirye-shiryen kasuwanci na farko.
Kamar yadda tsohuwar maganar ke cewa, "Matsalar da aka bayyana da kyau ita ce matsalar da aka warware rabin-rabi." A wannan yanayin, ฦalubalen da ake fuskanta sau da yawa lokacin aiki tare da fayil na STATUS VSAM ya haษa da kurakurai da sarrafa bayanai yadda ya kamata. Sa'ar al'amarin shine, tare da ayyuka masu ฦarfi na Cobol da fahimtar fahimtar yadda VSAM ke aiki, wannan matsalar ta zama mai yiwuwa.
Fahimtar VSAM FILES
Mu shiga cikin mafita. Cobol, kasancewa babban yare, yana ba da damar sarrafa fayilolin VSAM ta hanyar samar da jumlar MATSAYI fayil. Wannan sashe yana taimakawa wajen sarrafa kuskure a ayyukan I/O fayil. Madaidaicin tsarin wannan juzu'in shine 'MATSAYIN DATA-suna-1'. A wannan yanayin, `data-name-1` filin haruffa biyu ne inda haruffan farko ke nuna babban matsayi, na biyu kuma don takamaiman dalili (idan akwai).
ZABEN FILESUNA ZUWA 'VSAMFILE'
KUNGIYAR ANA ILMI
YANAYIN SAMUN BANZA
MATSAYIN FILE WS-VSAM-MATSAYI.
Fayil STATUS ษin da aka yi amfani da shi anan shine `WS-VSAM-STATUS`, wanda ke nuna matsayin kowane aikin fayil. Ta hanyar duba wannan matsayi bayan kowane aiki, sarrafa kuskure yana zama mai sauฦi.
##
Shirye-shiryen Cobol da fayilolin VSAM: Bayanin Code
Da fari dai, sashin SELECT FILENAME yana ma'anar ayyana sunan fayil ษin. Sanya wa 'VSAMFILE' yana nuna cewa shirinmu na Cobol zai koma ga fayil ษin VSAM ta wannan sunan fayil na alama. Bugu da ฦari, ORGANIZATION IS INNDEXED clause yana ฦayyadaddun cewa fayil ษin an tsara shi a cikin tsari mai ฦididdiga. HANYOYIN SAMUN RANDOM yana ba da damar kowane rikodi don samun damar shiga kai tsaye maimakon jere.
Kara karantawa